Last active
May 28, 2022 12:44
-
-
Save chunibyo-wly/06e0f109b93da7457c8a69478d81c472 to your computer and use it in GitHub Desktop.
peggy
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
start | |
= operation | |
operation | |
= WSS a:entity WSS b:operator WSS c:operation WSS { return `${a} ${b} ${c}`; } | |
/ WSS a:entity WSS b:operator2 WSS c:operation WSS { return `${a}${b}${c}`; } | |
/ WSS a:entity WSS c:operation WSS { return `${a}${c}`; } | |
/ WSS a:entity WSS { return a; } | |
entity "entity" | |
= e:ident_part+ { return e.join(''); } | |
/ "{" WSS e:operation WSS "}" { return `{${e}}`; } | |
/ "(" WSS e:operation WSS ")" { return `(${e})`; } | |
/ b:built_in_operator e:ident_part+ { return `\\${e.join('')}`; } | |
built_in_operator "built_in_operator" | |
= "\\" | |
ident_part | |
= [A-Za-z0-9] | |
operator "operator" | |
= [\+\-\*\/=] | |
operator2 "operator2" | |
= [_^] | |
WSS "whitespaces" | |
= [ \t\r\n]* |
Author
chunibyo-wly
commented
May 28, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment