Skip to content

Instantly share code, notes, and snippets.

@gvx
Created March 6, 2011 22:37
Show Gist options
  • Save gvx/857812 to your computer and use it in GitHub Desktop.
Save gvx/857812 to your computer and use it in GitHub Desktop.
DejaVu test for parsing tree
func some function:
a test
catch handler:
some mistake
if this is wrong:
tell me why
elseif this should not fail:
hello
if hi:
bye
labda x:
x
call
else:
shut up
while we live:
for ever and ever:
this is still a test
fib n:
if <= n 1:
return n
return + fib - n 1 fib - n 2
this is it
File[FuncStatement[ArgumentList
BodyClause[Line
CatchStatement[ErrorHandler
BodyClause[Line
IfStatement[IfClause[ConditionClause
Line
]
ElseIfClause[ConditionClause
Line
IfStatement[IfClause[ConditionClause
Line
LabdaStatement[ArgumentList
BodyClause[Line]
]
Line
]]
]
ElseClause[Line]
]
]
]
]
]
WhileStatement[ConditionClause
BodyClause[ForStatement[ForClause
BodyClause[Line]
]]
]
FuncStatement[ArgumentList
BodyClause[IfStatement[IfClause[ConditionClause
Line
]]
Line
]
]
Line
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment