Bogus syntax errors flagged compiling app with v0.9.pre-alpha-2 using R18

14 views
Skip to first unread message

Graeme Defty

unread,
Nov 28, 2015, 1:38:06 AM11/28/15
to chica...@googlegroups.com
Having investigated this a little more I am convinced there is an issue here.

It is easily reproducible (as described below).

Would someone like to raise an issue for this?  (I am happy to do it, if that's OK)

Looks like a good candidate for a fix before 0.9 is released.  ;-)

Graeme
________

To produce the error:

make app PROJECT=bug_demo

Then create a controller/bug_demo_test_controller.erl with content of

1   -module(bug_demo_test_controller, [Req, SessionId]).
2   -compile(export_all).

4   index('GET',[]) ->
5      Rslt = 1 - length([1,2,3]),
6     {output, "Hello, world!"}.

Compilation fails on line 5 with a syntax error before 'length'.

Changing the '-' to a '+' avoids the error, as does replacing length([1,2,3]) with a simple constant or variable. The error seems to be specific to parsing a '-' sign as the last operator in an expression when the last operand is a function call.




Dmitry Polyanovsky

unread,
Nov 30, 2015, 3:38:40 AM11/30/15
to ChicagoBoss
Hi,

thanks for a report. I think it's related to this issue https://github.com/ErlyORM/aleppo/issues/6

Graeme Defty

unread,
Nov 30, 2015, 4:30:16 AM11/30/15
to chica...@googlegroups.com
Hi Dmitry,

Yes indeed - looks like the same error exactly. Sorry I didn't find out for myself that it had already been reported :-(  (and sorry for creating so much noise on the list in the process of identifying it)

If anyone else has this issue it is easily worked around as a temporary fix by putting brackets around the final term.

graeme



--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/0b6479d5-f89d-4245-827f-1f82293e1e81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages