0
votes

I'm attempting to parse a "function call" for a language that I am creating, but I am getting:

:30:0 Syntax error: Operator expected

The first line below is where I am getting my error:

Fun(FXs) -->   name(F),
                ws,
                [0'(],
                ws,
                args(Xs),
                ws,
                [0')],
                {FXs =.. [F, Xs]}.

 name(N) -->  id(Cs),
             {atom_chars(Cs, N)}.

I have exhaustively searched Google for help with errors in DCG parsing, and I have not found anything. An explanation on what I am doing wrong will be helpful, or any resources that would allow me to understand DCG more!

1

1 Answers

2
votes

I guess it's Fun: you should write fun instead. SWI-Prolog has an extension to allow CamelCase functors, but must be enabled.