From c80c632ed2e844a66207da5fb462960ecca219f5 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 20 Nov 2014 01:31:24 +0100 Subject: lexer library: added M[lexer.checkheader] and M[lexer.checkname] for matching a pattern against the first line of a buffer or its filename. This simplifies the "lexer.test..." macros and allows us to select lexers based on the #! line. --- lib/lexers/cpp.tes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/lexers/cpp.tes') diff --git a/lib/lexers/cpp.tes b/lib/lexers/cpp.tes index f979153..f07555a 100644 --- a/lib/lexers/cpp.tes +++ b/lib/lexers/cpp.tes @@ -1,7 +1,7 @@ ! C/C++ Lexing ! @[lexer.test.cpp]{ - [_ :S.[c,cc,cpp,cxx,h,hh,hpp,hxx,ipp,m,mm,sma] ]_ + [_ _.[c,cc,cpp,cxx,h,hh,hpp,hxx,ipp,m,mm,sma]M[lexer.checkname] ]_ } @[lexer.set.cpp]{ @@ -39,5 +39,5 @@ } @:[lexer.auto]{ - :M[lexer.test.cpp]"S Q.fEB :M[lexer.set.cpp] Oend ' + :M[lexer.test.cpp]"S :M[lexer.set.cpp] Oend ' } -- cgit v1.2.3