New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nools compile: Unexpected token name «start», expected punc «,» #61

Closed
devijvers opened this Issue Aug 30, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@devijvers

devijvers commented Aug 30, 2013

I have no clue what is wrong with this rule:

rule "some rule" {
  when {
    $q: String $q == "start";
  }
  then {
  }
}

When I run nools compile I get this error:

Unexpected token name «start», expected punc «,»
Error
    at new JS_Parse_Error (/usr/lib/node_modules/uglify-js/lib/parse.js:196:18)
    at js_error (/usr/lib/node_modules/uglify-js/lib/parse.js:204:11)
    at croak (/usr/lib/node_modules/uglify-js/lib/parse.js:636:9)
    at token_error (/usr/lib/node_modules/uglify-js/lib/parse.js:644:9)
    at expect_token (/usr/lib/node_modules/uglify-js/lib/parse.js:657:9)
    at expect (/usr/lib/node_modules/uglify-js/lib/parse.js:660:36)
    at expr_list (/usr/lib/node_modules/uglify-js/lib/parse.js:1137:44)
    at /usr/lib/node_modules/uglify-js/lib/parse.js:1152:23
    at /usr/lib/node_modules/uglify-js/lib/parse.js:683:24
    at expr_atom (/usr/lib/node_modules/uglify-js/lib/parse.js:1115:35)
@devijvers

This comment has been minimized.

Show comment
Hide comment
@devijvers

devijvers Aug 30, 2013

Found it: nools compile only seems to allow single quoted strings in the when {} clause. This is strange because the nools.compile() function does accept double quoted strings.

devijvers commented Aug 30, 2013

Found it: nools compile only seems to allow single quoted strings in the when {} clause. This is strange because the nools.compile() function does accept double quoted strings.

@devijvers devijvers closed this Aug 30, 2013

doug-martin added a commit to doug-martin/nools that referenced this issue Sep 4, 2013

v0.1.10
* Added ability to `import` other nools files to create composible rules files [#58](noolsjs#58)
* When using `global` to require other files you can now require other files relative to the nools file
* Added uglify-js as a dependency instead of devDependency #71
* Fixed issue #61 where transpile would not properly escape `"` character.
* Fixed issue #66 and #67 where regular expression matching was too greedy.
* Fixed issue #62 where constraints with a `"` character would produce invalid javascript when `transpiling`.
* Fixed issue #69 where rules names with a `'` character in a rule would produce invalid javascript when `transpiling`.

@doug-martin doug-martin referenced this issue Sep 4, 2013

Merged

v0.1.10 #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment