Skip to content

Adding capability for ternary expression as a separate scope #129

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
merged 3 commits into from
Jun 8, 2016

Conversation

anubmat
Copy link
Contributor

@anubmat anubmat commented Mar 17, 2016

Solving Issue #124, #80, #81

@@ -26,11 +26,18 @@ repository:
'1': { name: variable.ts }
end: (?=$|[;,])
patterns:
- include: '#ternary-operator'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't ternary-operator just part of expression?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If what you mean is why we need a 'ternary-operator' as a new addition, there are 2 reasons I can think of:

  1. To make (? + expression + :) together
  2. #Type-annotation consumes " : followed by something" before we can get to #expression. Even if we change the order in which they are present. It will include : followed by something as #type-annotation instead of skipping it to look for an expression.

patterns:
- include: '#ternary-expression-type'

ternary-expression-type:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document (in comments) exactly what this is supposed to capture? For instance, why do you need types covered here?

@zhengbli
Copy link
Contributor

👍

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.

5 participants