@@ -21,7 +21,10 @@ set cpo&vim
21
21
22
22
syn case match
23
23
24
- syn match ninjaComment / #.*/ contains =@Spell
24
+ " Comments are only matched when the # is at the beginning of the line (with
25
+ " optional whitespace), as long as the prior line didn't end with a $
26
+ " continuation.
27
+ syn match ninjaComment / \(\$\n\)\@ <!\_ ^\s *#.*$/ contains =@Spell
25
28
26
29
" Toplevel statements are the ones listed here and
27
30
" toplevel variable assignments (ident '=' value).
@@ -38,12 +41,13 @@ syn match ninjaKeyword "^subninja\>"
38
41
" limited set of magic variables, 'build' allows general
39
42
" let assignments.
40
43
" manifest_parser.cc, ParseRule()
41
- syn region ninjaRule start =" ^rule" end =" ^\z e\S " contains =ALL transparent
42
- syn keyword ninjaRuleCommand contained command deps depfile description generator
44
+ syn region ninjaRule start =" ^rule" end =" ^\z e\S " contains =TOP transparent
45
+ syn keyword ninjaRuleCommand contained containedin =ninjaRule command
46
+ \ deps depfile description generator
43
47
\ pool restat rspfile rspfile_content
44
48
45
- syn region ninjaPool start =" ^pool" end =" ^\z e\S " contains =ALL transparent
46
- syn keyword ninjaPoolCommand contained depth
49
+ syn region ninjaPool start =" ^pool" end =" ^\z e\S " contains =TOP transparent
50
+ syn keyword ninjaPoolCommand contained containedin = ninjaPool depth
47
51
48
52
" Strings are parsed as follows:
49
53
" lexer.in.cc, ReadEvalString()
0 commit comments