Skip to content
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
Closed

Comments

@devijvers
Copy link

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
Copy link
Author

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.

doug-martin added a commit to doug-martin/nools that referenced this issue Sep 4, 2013
* Added ability to `import` other nools files to create composible rules files [noolsjs#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 noolsjs#71
* Fixed issue noolsjs#61 where transpile would not properly escape `"` character.
* Fixed issue noolsjs#66 and noolsjs#67 where regular expression matching was too greedy.
* Fixed issue noolsjs#62 where constraints with a `"` character would produce invalid javascript when `transpiling`.
* Fixed issue noolsjs#69 where rules names with a `'` character in a rule would produce invalid javascript when `transpiling`.
@doug-martin doug-martin mentioned this issue Sep 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant