Last active
December 9, 2017 18:55
-
-
Save ihavenonickname/89876a6786b0f12b05dee95088502fe2 to your computer and use it in GitHub Desktop.
i dont know what im doing
This file contains 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
Expr0 = Ws expr:(Appl / Expr1) Ws { | |
return expr | |
} | |
Expr1 = expr:(Func / Name / Expr0Parenthesis) { | |
return expr | |
} | |
Expr0Parenthesis = '(' expr:Expr0 ')' { | |
return expr | |
} | |
Appl = exprLeft:Expr1 Ws exprRight:Expr0 { | |
return { | |
tag: 'application', | |
exprLeft: exprLeft, | |
exprRight: exprRight | |
} | |
} | |
Func = '\\' Ws name:Name Ws '.' Ws expr:Expr0 { | |
return { | |
tag: 'function', | |
name: name, | |
expr: expr | |
} | |
} | |
Name = name:[a-z]i+ { | |
return { | |
tag: 'name', | |
value: name.join('') | |
} | |
} | |
Ws = [ \t\r\n]* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment