Created
May 2, 2018 14:33
-
-
Save nedzadarek/7845ab73a7aa266e7d518f404a62b68d to your computer and use it in GitHub Desktop.
Parse lines (to new-line marker)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bl: [a b | |
c | |
] | |
parse bl [any [pos: if (not new-line? pos) skip] 'c] | |
; == true | |
bl: [ a b -> a + b | |
c d -> c * (c + d) | |
] | |
line-rule: [word! word! '-> [any [pos: if (not new-line? pos) skip] ] ] | |
parse bl [ | |
any line-rule | |
] | |
bl: [ a b -> a + b | |
c d -> c * (c + d) | |
] | |
line-rule: [ | |
set w1 word! set w2 word! (print mold reduce ["words: " w1 w2]) | |
'-> | |
start-pos: [any [pos: if (not new-line? pos) skip] ] end-pos: (print mold reduce ["code: " copy/part start-pos end-pos] )] | |
parse bl [ | |
any line-rule | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment