[erlang-questions] Question in Parser Implementation

Vlad Dumitrescu vladdu55@REDACTED
Sat Jul 24 21:10:25 CEST 2010


2010/7/24 黃耀賢 (Yau-Hsien Huang) <g9414002.pccu.edu.tw@REDACTED>:
> Then I tested it using a query
>
>    parser:alt(parser:fail, parser:literal($3), "345").
>
> and found that it does not accept the syntax 'parser:fail' for
> representing a function. The erl reports "Illegal expression" for
> the query.

Hi,

Try
parser:alt(fun parser:fail/1, parser:literal($3), "345").

http://www.erlang.org/doc/reference_manual/expressions.html#id2275688

regards,
Vlad


More information about the erlang-questions mailing list