-
Notifications
You must be signed in to change notification settings - Fork 4
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
Let parsing be scope dependent #6
Comments
I don't object to this per se. I don't think it would be terrible for the platforms (which have to do resolution eventually anyway), though probably annoying to have argument lists in a limbo state until resolution. I wonder if we might have some use cases in which folks want to parse without resolving though - maybe in transformers? |
Yes, we definitely do. For example, the formatter doesn't resolve and really doesn't want to to keep performance good. At the same time, the formatter definitely does need to distinguish between a generic method and a series of comparisons here since they are formatted differently. Personally, I'd rather keep the grammar context free and just pick a disambiguation rule. I think the generic method case will be much more common, so I'd just parse it as that. |
Afaik the current angular 2 transformer design relies heavily on parsing without resolving, @kegluneq would have more info on that. |
+1 @jakemac53, that is the goal. We may choose to resolve when parsing isn't enough (e.g. to understand enough to generate useful error messages), but we'd like that to be the exception, not the rule. |
Another option, which requires more from the parser, is to allow parsing to depend on whether, e.g.,
z
above is a type name or not. SinceType
objects won't have a>
operator, there is no existing functioning code wherez
is a type.It does require the parser to delay final judgement on the expression/expression list parsing until it has resolved identifiers, but it might be possible.
Making a breaking change is also possible.
The text was updated successfully, but these errors were encountered: