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

Simplify expression parsing #235

Merged
merged 1 commit into from
Jun 7, 2016
Merged

Simplify expression parsing #235

merged 1 commit into from
Jun 7, 2016

Conversation

asottile
Copy link
Collaborator

@asottile asottile commented Jun 7, 2016

Resolves #218
Resolves #236

Also makes #81, #183, and #189 actually possible

High level changes:

  • ${ foo } is a syntax error -- identifiers cannot start with whitespace
  • $() and $[] are no longer valid placeholders, use ${} instead
  • gettext parsing was removed -- this never worked entirely properly and you can do better by augmenting ._global_vars, compiling, and then scan the compiled output
  • $foo()bar no longer compiles to foo().bar
  • newlines in expressions are preserved moar (see Inline comment in multiline expression creates syntax error #236)
  • escaped newlines in expressions are preserved

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 7b54847 on simplify_expression_parsing into a72c72d on master.

@asottile
Copy link
Collaborator Author

asottile commented Jun 7, 2016

After this, the compiler + parser are under 1500 lines which is quite the improvement

$ wc -l Cheetah/legacy_*.py
  566 Cheetah/legacy_compiler.py
  783 Cheetah/legacy_parser.py
 1349 total

@bukzor bukzor merged commit 5786365 into master Jun 7, 2016
@bukzor bukzor deleted the simplify_expression_parsing branch June 7, 2016 19:19
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.

3 participants