Skip to content

Commit

Permalink
add jcut
Browse files Browse the repository at this point in the history
  • Loading branch information
tangentstorm committed Jul 28, 2021
1 parent 38390b4 commit ff04472
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
│└──────┴─────┴──────┴─────┴──────┴─────┴─────┴─────┴──────┘│
└───────────────────────────────────────────────────────────┘

jcut_jlex_ '{{ i. 10,y }}' NB. like ;: but preserve spaces
┌──┬─┬──┬─┬──┬─┬─┬─┬──┐
│{{│ │i.│ │10│,│y│ │}}│
└──┴─┴──┴─┴──┴─┴─┴─┴──┘

jtype_jlex_ '{{' NB. return the type code for a single token
D

See `help_jlex_` for what the token descriptor codes mean.

## Known Limitations
Expand Down
3 changes: 3 additions & 0 deletions j-lex.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ jlex =: {{
if. 'literal' -: datatype y do. y =. ,. LF cut y -. CR end.
(jtype;]) L:0 jtokens each y }}

NB. jcut is like ;: but preserves whitespace
jcut =: {{>>L:_1 {:L:1 jlex y}}

jlex_z_ =: jlex_jlex_

0 comments on commit ff04472

Please sign in to comment.