[SVN] Regular Expression Language Grammar
Allan Odgaard
throw-away-1 at macromates.com
Wed Jun 14 23:56:05 UTC 2006
On 14/6/2006, at 23:08, Gerd Knops wrote:
> # Names and coloring #
>
> [...]
> On the other hand while going through some more complex regex it is
> great to do Ctrl-Shift-P and see
> 'string.regexp.quantifier.reluctant.1_or_more' or some such to
> explain what is happening at that point in the regex.
>
> Any suggestions?
Not entirely sure I followed your naming/reasoning here, but
generally never defer from the naming conventions, which generally
dictate the first two parts of the scope, not only the first, so e.g.
string.newline is not appropriate.
I believe here you’d want constant.character.escape.newline.regexp
if we are talking about \n for string.newline.
So do derive from existing established names, but add the extra
information to the end -- I also like using ⌃⇧P as a guide to what
the current element is, so the added information is definitely
useful, but put it in already established namespaces.
> # Include and Match/Captures #
>
> Sometimes there are constructs where a match would be much better
> suited than begin and end, but I want to include something [...]
> [...]
> Is there any workaround for patterns like these?
There is no workaround, but the ability to add other rule properties
to a capture (such as include or patterns) will appear in next
revision of the language parser.
This one will almost certainly also have the language grammar
injection Michael mentioned (my main motivation for a new revision,
that and adding a bit more line-context to matching) -- as usual I
can’t really say when, other than my fingers are itching for working
on this, but at the same time 2.0 is a bit of a road blocker, which I
really need to get out of the way…
More information about the textmate-dev
mailing list