wpbasti/jasy — Issue #7: RegExp literal in array causes "jasy.js.parse.Parser.SyntaxError: Syntax error: Missing operand. Found type: div"
Author: csakatoku
Created: 2012-02-10 08:43:28+00:00
State: open

Jasy(both 0.4.6 and 0.5 beta2) seems to treat RegExp literals in an array as syntax error.

The following code,

core.Class("p.helloworld.App", {
construct: function(settings) {
var arr = [/pattern/];
}
});

will output this error.

% ./jasyscript.py build
Jasy 0.5-beta2
Initialized project core
Initialized project p.helloworld
Detecting dependencies...
Traceback (most recent call last):
File "/Users/csakatoku/.virtualenvs/jasy/bin/jasy", line 110, in
# skip...
File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1311, in MultiplyExpression
node = UnaryExpression(tokenizer, staticContext)
File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1338, in UnaryExpression
node = MemberExpression(tokenizer, staticContext, True)
File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1367, in MemberExpression
node = PrimaryExpression(tokenizer, staticContext)
File "/Users/csakatoku/.virtualenvs/jasy/lib/python3.2/site-packages/jasy/js/parse/Parser.py", line 1535, in PrimaryExpression
raise SyntaxError("Missing operand. Found type: %s" % tokenType, tokenizer)
jasy.js.parse.Parser.SyntaxError: Syntax error: Missing operand. Found type: div
p.helloworld.App:3
Closing session...

FYI, my jascript.py is here.

- https://gist.github.com/1787832