I'm writing a new GtkSourceView language specification; following the information found in the tutorial and on other internet resources. The language that I'm defining can take a digit as:
- One or more
digit
characters- Optionally an appened (e.g. at the end) letter
L
,l
,N
, orn
.
Examples:
1000
1234L
987654321n
Please note that this is just one of a few possible definitions.
So far, I've written (approximately (Other parts of the definition ommitted)):
<context id="number" style-ref="decimal" end-at-line-end="true">
<start>(\d+)([NnlL]?)</start>
<end>\D</end>
</context>
I interpret that as: _A number
starts with one or more digit characters, optionally followed by any of the follwing: N
n
l
L
, and ends when a non digit number is encountered (e.g. space, letter.)
Unfortunately this doesn't quite work, since appending any of the specified characters (or any character for that matter) causes it to fail (in this context, that means not highlight.)
Any ideas on how to match this pattern? Thanks in advance! :)