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

Allow "- var" and "-" statements for declaring variables within templates #92

Closed
wants to merge 10 commits into from
Closed

Conversation

larsonjj
Copy link

Currently, there isn't any support for - var someVar = "someString" or - someVar = "someString" statements. They must be someVar = "someString". This breaks compatibility with the official Jade library. So to remedy this issue, a RegEx replace statement has been added that looks for the - var or - statements, removes them, and lets the Scanner continue on normally.

Currently, there isn't any support for `- var someVar = "someString" statements. They must be `someVar = "someString"`. This breaks compatibility with the official Jade library. So to remedy this issue, a RegEx replace statement has been added that looks for the `- var` statements, removes them, and lets the Scanner continue on normally.
@larsonjj larsonjj changed the title Update Scanner.java Allow "- var" statements within templates Feb 15, 2015
Updated `- var` regex remover to better avoid false positives
@naltatis
Copy link
Member

Thanks for the PR! Il will test it out in the next days.

@larsonjj larsonjj changed the title Allow "- var" statements within templates Allow "- var" and "-" statements for declaring variables within templates Feb 16, 2015
@marlonbernardes
Copy link
Contributor

Recompiling the regular expression inside a loop (Pattern.compile) could severely hurt performance.

Moved RegEx compilation outside of loop for better performance.
@larsonjj
Copy link
Author

Any update here?

@marlonbernardes
Copy link
Contributor

@larsonjj this repo is not active anymore.

* master:
  Update README.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release jade4j-0.4.3
  Fix failed tests on Java 8: issue #67.
  Add more versions of JDK to CI.
  issue89: Test files renamed (was #89 instead of #90).
  issue90: Saved example file provided in bug report.
  changed > to > in ArgumentSplitter's javadoc
  argument splitter now handles braces (but still very basic support)
  added tests that test splitting arguments with nested function calls
  version revert
  added getters (required when traversing ast)
  added compiler tests for 'comma bug' in 'mixin' node
  changed version name
  fixed 'quotes mistake'
  doc and comments
  string builder as local member instead of class member
  added test, fixed bugs, applied changes from review
  Proper splitting of arguments for mixin node
  performance improvement - short circuit if statements
@chbloemer
Copy link
Contributor

This feature should be in 1.0.0 and up. So, close this Pull-Request.

@chbloemer chbloemer closed this Nov 24, 2015
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

Successfully merging this pull request may close these issues.

None yet

4 participants