Skip to content

Commit

Permalink
fixed error with function parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
emekoi committed Oct 12, 2019
1 parent 3476c17 commit 7a6ebce
Show file tree
Hide file tree
Showing 4 changed files with 312 additions and 296 deletions.
6 changes: 4 additions & 2 deletions Syntaxes/Zig.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repository:
match: \\u\{[a-fA-F0-9]{1,6}\}

param_list:
begin: '(?<=\(|,)\s*([a-zA-Z_][a-zA-Z0-9_]*|@\".+\")\s*(:)\s*'
begin: '([a-zA-Z_][a-zA-Z0-9_]*|@\".+\")\s*(:)\s*'
beginCaptures:
'1':
name: variable.parameter.zig
Expand Down Expand Up @@ -287,6 +287,7 @@ repository:
name: storage.type.zig

patterns:
- include: '#label'
- include: '#param_list'
- include: '#main'

Expand All @@ -313,6 +314,7 @@ repository:
name: storage.type.zig

patterns:
- include: '#label'
- include: '#param_list'
- include: '#main'

Expand Down Expand Up @@ -341,7 +343,7 @@ repository:
name: storage.type.zig

enum_literal:
match: '(?<!\w|\))(\.(?:[a-zA-Z_][a-zA-Z0-9_]*|@\".+\"))'
match: '(?<!\w|\))(\.(?:[a-zA-Z_][a-zA-Z0-9_]*|@\".+\"))\b(?!\()'
name: constant.language.enum

main:
Expand Down
12 changes: 10 additions & 2 deletions Syntaxes/Zig.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<key>enum_literal</key>
<dict>
<key>match</key>
<string>(?&lt;!\w|\))(\.(?:[a-zA-Z_][a-zA-Z0-9_]*|@\".+\"))</string>
<string>(?&lt;!\w|\))(\.(?:[a-zA-Z_][a-zA-Z0-9_]*|@\".+\"))\b(?!\()</string>
<key>name</key>
<string>constant.language.enum</string>
</dict>
Expand Down Expand Up @@ -324,6 +324,10 @@
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#label</string>
</dict>
<dict>
<key>include</key>
<string>#param_list</string>
Expand Down Expand Up @@ -371,6 +375,10 @@
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#label</string>
</dict>
<dict>
<key>include</key>
<string>#param_list</string>
Expand Down Expand Up @@ -575,7 +583,7 @@
<key>param_list</key>
<dict>
<key>begin</key>
<string>(?&lt;=\(|,)\s*([a-zA-Z_][a-zA-Z0-9_]*|@\".+\")\s*(:)\s*</string>
<string>([a-zA-Z_][a-zA-Z0-9_]*|@\".+\")\s*(:)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down
Loading

0 comments on commit 7a6ebce

Please sign in to comment.