Conversation
examples: * single line comment: type:node and natural=tree // this selects all trees * inline comment highway in (unclassified, road /* outdated tag */, service)
|
Great, :) I really like the possibility to make comments. What I noticed that the current implementation will treat part of unquoted URLs as comment. I wonder if we could extend the comment token such that URLs do not need to be quoted (E.g a required whitespace before the In general, I feel like we only need block comments and no inline comments. But that might be just a personal preference. Would restriction to one type of comment syntax make the language simpler and maybe less error prone? |
|
Good point regarding the potential pitfall of something like
Currently, it is not possible to use URLs in unquoted strings in the filter language. Let's continue this in a separate ticket: #29
I assume that you mean that we only need the Let's say we reduce it to a single style of comment. We have a couple of options: COMMENT: '//' ~[\n\r]* ('\r'? '\n' | EOF) -> skip;The current version of the PR, could be confusing when one tries to do something like COMMENT: '--' ~[\n\r]* ('\r'? '\n' | EOF) -> skip;
Unfortunately, because COMMENT: '#' ~[\n\r]* ('\r'? '\n' | EOF) -> skip;Maybe using the python-style comments using a single COMMENT: '/*' .*? '*/' -> skip;Another approach would be to only allow |
Implements #25 as C-style comments, e.g.:
type:node and natural=tree // this selects all treeshighway in (unclassified, road /* outdated tag */, service)