-
Notifications
You must be signed in to change notification settings - Fork 94
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
syntax: add reference syntax files for testing lexers #2916
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial feedback from a first read & cross-reference with the files displayed in emacs.
As a general comment, do we intend to define a standard in terms of what features should display in the same mode (as opposed to what features should each display as single consistent units by mode)? For an example to make that distinction clearer, here we seem to be implying [a]
, [[d]]
& [[l, m, n]]
should each individually display in one colour, but should we outline that they should all have the same colour (say to group them as a set of section headings)? Full consistency is not essential but it could be useful for comprehension purposes.
If we wanted to push for consistency in this way, we should provide strict instructions & remove preference advice e.g. optionally <PATTERN> could be highlighted
instances.
{% from 'foo' import foo as a, b %} | ||
|
||
# SYNTAX 3.3 | ||
# multi-line templating code should be consistent with single-line code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps to convey that all four examples below are meant to display consistently as a unit, though only the top two are commented as such at the moment, add instead one line at the top here similar to # for each case, all three lines should display as a single unit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda depends how template markup is handled, for instance the syntax highlighter might wish to highlight keywords or literals differently.
I've updated the comment to make extra clear that whatever the behaviour implemented by the lexer it should be consistent no matter how many lines they are spread over.
11b399e
to
8ca36e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous feedback addressed really well, with the 'SYNTAX: 2.10' now especially comprehensive. I've noticed that the numbering is not consistent between the EmPy file & the master table, & possibly one typo, but otherwise I am happy to approve.
I'll now go & double-check that the revised reference table is correct for Emacs, given my recent update to that lexer.
""" | ||
|
||
# syntax 3./2.5 | ||
# clashing xtrigger and empy syntax should somehow be handled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well anticipated!
In general, implementing lexers supporting all the listed syntactical elements cleanly & consistently will be rather tricky I think, for reasons such as this i.e. given different interpretations under the suite.rc
mode & the two templating engines.
8ca36e3
to
b4ed8ed
Compare
Yep, that would be nice! |
Addresses #2915
Add some example Cylc files for testing lexers, the numbering matches the table in #2752.