[TxMt] Language grammar question
Michael Sheets
mummer at whitefalls.org
Sun Jun 3 23:46:52 UTC 2007
On Jun 3, 2007, at 4:11 PM, Pavan Gunupudi wrote:
> I am writing a bundle for Spice-like circuit simulator input files.
> For these text files, one of the rules is to have the first line as
> a comment, no matter what is on the line. I was wondering how this
> could be incorporated into the language grammar to set the
> appropriate scope for the first line.
This would almost be impossible because there is no way for a match
or begin to see any surrounding line, hence it is impossible to know
if your on the first line or not.
However we know there is a first line, so we can create a begin/end
match that never ends to match the first line:
http://pastie.textmate.org/67495
Then put the remaining patterns inside it, case solved. (Note the use
of capture 0 here, which matches the entire begin line.)
More information about the textmate
mailing list