You can use a regular expression with the match key. For example in the Python bundle : { name = 'constant.numeric.integer.hexadecimal.python'; match = '\b(?i:(0x\h*))'; };
Grammar writing is well explained there : https://manual.macromates.com/en/language_grammars https://manual.macromates.com/en/language_grammars although this in in the TextMate 1 documentation.
Le 1 nov. 2015 à 20:37, Jacob Carlborg doob@me.com a écrit :
To create a pattern in a TextMate grammar that matches across multiple lines the "begin" and "end" keys are necessary. But is it possible to somehow restrict what is matched between the begin and the end?
I'm trying to create a pattern for the hex string literal in D. It's like a regular string literal but can only contain hex characters.
-- /Jacob Carlborg
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate