fix parser
This commit is contained in:
parent
39f05e2796
commit
737cc9fbab
@ -20,13 +20,11 @@
|
||||
parse(Input) when is_binary(Input) ->
|
||||
Tokens = lexer(Input),
|
||||
{ok, AST} = parser(Tokens),
|
||||
lists:foreach(fun(E) ->
|
||||
lager:debug("block: ~p", [E])
|
||||
end, parse_ast(AST)),
|
||||
|
||||
case validate(AST) of
|
||||
ok -> {ok, AST};
|
||||
{error, Reason} -> {error, Reason}
|
||||
try validate(AST) of
|
||||
ok ->
|
||||
{ok, AST}
|
||||
catch throw:Reason ->
|
||||
{error, Reason}
|
||||
end.
|
||||
|
||||
parse_file(Filename) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user