dart-archive/angular_analyzer_plugin

Conclusive selector support

Closed this issue · 5 comments

Edited: Looks like we are lacking in full :not support, wildcards, and ids. Combinations are allowed. Part of doing this ticket will be evaluating the differences between the source at the bottom and what we support so far

Original: Right now we support only a few options for selectors, and we don't support them in combination.

However, the comments for selector in the angular dart codebase reveals that it can be any mix of classes, properties with or without values, property wildcards, and/or an element name

https://github.com/angular/angular.dart/blob/master/lib/core_dom/selector.dart#L9

Only id selectors and selectors spanning multiple elements are not supported afaik

Ah, you are right. Its already very conclusive including an AST.

I saw this regex https://github.com/dart-lang/angular2-dart-analyzer/blob/master/analyzer_plugin/lib/src/selector.dart#L185 and thought it code meant to last short term, but yes, it has an AST and everything.

Angular itself doesn't support selectors with spanning elements, so it looks like we just need to handle :not and ids.

FWIW the regex was taken from a TypeScript version of Angular.

Yeah, the regex is applied perfectly well as a tokenizer. I just had my
regular-languages-arent-context-free-grammars instinct (wrongly) go off
when I stumbled across that code and didnt look deeper into it. But
obviously token streams are regular languages, my instinct went off too
soon!

This was mostly solved forever ago, with the exception of :contains. While that means it isn't yet "conclusive" support, I'm going to close this and open up a new one for :contains so we can track it separately.