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

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

1 participant

@devijvers

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

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 doug-martin added a commit to doug-martin/nools that referenced this issue Sep 4, 2013
@doug-martin doug-martin v0.1.10
* Added ability to `import` other nools files to create composible rules files [#58](C2FO#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`.
fcec129
@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