Menu

#21 Assigment needs higher precedence

open
None
4
2005-11-30
2005-11-30
No

Hi,

Sould assignment(:=) have a higher precedence? At the
very least, should it be more important that a comma?
The following example causes an error:

:-) var a = absent;
:-) "hello", a := "there";
MISHAP : Illegal expression on left hand side of
assignment
BECAUSE : Only single name expressions are allowed(at
the moment!)
LEFT HAND SIDE :
org.millscript.millscript.expr.CommaExpr@488e32e7
RIGHT HAND SIDE :
org.millscript.millscript.expr.ConstantExpr@6fb000e7
ORIGIN :
org.millscript.millscript.StandardInputSource@2d04faf8
LINE NO. : 3

Parenthesis can be used as a workaround, e.g.

:-) "hello", ( a := "there" );
There is 1 result
"hello"

but I think this should probably be implied
grammatically anyway.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.