Skip to content

Instantly share code, notes, and snippets.

@ihavenonickname
Last active December 9, 2017 18:55
Show Gist options
  • Save ihavenonickname/89876a6786b0f12b05dee95088502fe2 to your computer and use it in GitHub Desktop.
Save ihavenonickname/89876a6786b0f12b05dee95088502fe2 to your computer and use it in GitHub Desktop.
i dont know what im doing
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