Skip to content

Initial support for Angular expression syntax #31

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

Merged

Conversation

deathaxe
Copy link

This PR...

resolves #30

  1. adds syntax definitions for Angular expression syntax, which is a subset of JavaScript. see: https://angular.dev/guide/templates/expression-syntax

    Required rules are directly implemented in favor of re-using/including JavaScript to reduce dependencies and keep syntax lean (from parser's point of view).

  2. adds syntax based folding rules to be able to fold control flow blocks regardless used indentation style.

  3. adds symbol list definition to index @let variables.

This commit...

1. adds syntax definitions for Angular expression syntax,
   which is a subset of JavaScript.
   see: https://angular.dev/guide/templates/expression-syntax

   Required rules are directly implemented in favor of re-using/including
   JavaScript to reduce dependencies and keep syntax lean (from parser's
   point of view).

2. adds syntax based folding rules to be able to fold control flow blocks
   regardless used indentation style.

3. adds symbol list definition to index `@let` variables.
@princemaple
Copy link
Owner

princemaple commented Dec 16, 2024

This is looking great. Mostly working alreay. Only breakage I found is after a line like this:

@let currency = orders.value()?.[0]?.extra?.currency;

The open angle bracket in <table> below this line shows

text.html.ngx meta.let.value.ngx keyword.operator.comparison.ngx

deathaxe added 2 commits December 16, 2024 12:38
This commit adds contexts for JavaScript specific of qualified variables.

It uses branching to properly match all parts even across multiple lines.
This commit assigns *.ngx file extensions as Angular Playground detects it
and assigns special syntax, too.
@princemaple
Copy link
Owner

Perfection. Thank you so much!

@princemaple princemaple merged commit bb25c66 into princemaple:master Dec 16, 2024
1 check passed
@deathaxe deathaxe deleted the feat/refactor-expression-syntax branch December 16, 2024 12:08
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.

Control block improvements
2 participants