6565
6666" go:generate; see go help generate
6767syn match goGenerateKW display contained / go:generate/
68- syn match goGenerateVars contained / \v\$ (GOARCH|GOOS|GOFILE|GOLINE|GOPACKAGE|DOLLAR)/
68+ syn match goGenerateVars contained / \v\$ (GOARCH|GOOS|GOFILE|GOLINE|GOPACKAGE|GOROOT| DOLLAR|PATH )/
6969syn region goGenerate excludenl contained matchgroup =goGenerateKW start =" ^//go:generate" end =/ $/ contains =goGenerateVars,goGenerateKW
7070
7171" go:build
@@ -83,13 +83,14 @@ syn match goCompilerDir excludenl display contained "\v^//go:%(nointer
8383" Adding a space between the // and go: is an error.
8484syn match goDirectiveError excludenl contained " ^// go:.\+ $"
8585
86- " Build tags; standard build tags from cmd/dist/build.go and go doc go/build.
86+ " Build tags:
87+ " go tool dist list | sed 's!/!\n!' | sort -u | tr '\n' ' '
8788syn match goOldBuildTag display contained " ^// +build.*"
88- syn keyword goStdBuildTags contained
89- \ 386 amd64 amd64p32 arm arm64 mips mipsle mips64 mips64le ppc ppc64 ppc64le
90- \ riscv64 s390x wasm darwin dragonfly hurd js linux android solaris
91- \ freebsd nacl netbsd openbsd plan9 windows gc gccgo cgo race
9289syn match goVersionBuildTags contained / \v <go1\. [0-9]{1,2}>[^.]/
90+ syn keyword goStdBuildTags contained
91+ \ gc gccgo cgo race
92+ \ 386 aix amd64 android arm arm64 darwin dragonfly freebsd illumos ios js linux loong64 mips mips64
93+ \ mips64le mipsle netbsd openbsd plan9 ppc64 ppc64le riscv64 s390x solaris wasip1 wasm windows
9394
9495" cgo
9596syn match goCgoError contained containedin =goComment " ^\% (\/\/\)\?\s *#cgo .*"
@@ -100,7 +101,7 @@ syn match goCgo contained containedin=goComment /^\%(\/\/\)\?\s*#\s*include [<"]
100101syn match goCgo contained containedin =goComment / \v ^%(\/\/ )?\s *#\s *%(ifdef \w +|ifndef \w +|else|endif)/
101102syn match goCgo contained containedin =goComment / \v ^%(\/\/ )?\s *#cgo pkg-config:%( \f +)+/
102103syn match goCgo contained containedin =goComment / \v ^%(\/\/ )?\s *#cgo
103- \ % (! ?% (386 |amd64|amd64p32 |arm|arm64|mips|mipsle|mips64|mips64le|ppc|ppc64|ppc64le|riscv64|s390x|wasm|darwin|dragonfly|hurd| js |linux|android|solaris|freebsd|nacl|netbsd|openbsd|plan9 |windows|gc|gccgo)[, ]* )*
104+ \ % (! ?% (386 |aix| amd64|android |arm|arm64|darwin|dragonfly|freebsd|illumos|ios| js |linux|loong64|mips|mips64|mips64le|mipsle|netbsd|openbsd|plan9|ppc64|ppc64le|riscv64|s390x|solaris|wasip1|wasm |windows|gc|gccgo)[, ]* )*
104105 \% (CFLAGS|CPPFLAGS|CXXFLAGS|FFLAGS|LDFLAGS):.+ /
105106
106107" String escapes.
@@ -122,15 +123,16 @@ else
122123endif
123124
124125" Structs and struct tags.
125- " TODO: also highlight lack of quote, and attr space error: `json:foo, omitempty`
126126syn region goStruct start =/ struct \? {/ end =/ }/ transparent containedin =goBlock contains =ALLBUT,goParen,goBlock,goStructTagOpt
127127syn match goStructTag / `.*`\% (\s\| $\) / contained containedin =goStruct
128- syn match goStructTagError / \w\{ -1,} *: *"/ he =e - 2 contained containedin =goStructTag
128+ syn match goStructTagError / \w\{ -1,} *: *"/ he =e - 2 contained containedin =goStructTag " Space before/after :
129129syn match goStructTagName / \w\{ -1,}:\z e"/ contained containedin =goStruct,goStructTag
130+ syn match goStructTagError / \w\{ -1,}:[^" ]\+ / contained containedin =goStructTag " Missing start quote
131+ syn match goStructTagError / \w\{ -1,}:"[^" ]\+ / contained containedin =goStructTag " Missing end quote
130132syn match goStructTagOpt / ,\z s[^,"]\+ / contained containedin =goStructTag
131133
132134if s: has (' string-fmt' )
133- " TODO: this is a bit slow, but can't seem ot make it faster. Not sure if it's
135+ " This is a bit slow, but can't seem ot make it faster. Not sure if it's
134136 " possible.
135137 "
136138 " % not preceded by a %, followed by any of [-#0+ ]
0 commit comments