Skip to content

Commit

Permalink
Fix #108
Browse files Browse the repository at this point in the history
  • Loading branch information
matter123 committed Apr 18, 2019
1 parent f5552b7 commit f2c6a86
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
40 changes: 12 additions & 28 deletions c/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -807,35 +807,19 @@
match: "%|\\*|/|-|\\+",
name: "keyword.operator.c"
},
{
begin: "\\?",
beginCaptures: {
"0" => {
name: "keyword.operator.ternary.c"
}
},
end: ":",
Range.new(
start_pattern: newPattern(
match: /\?/,
tag_as: "keyword.operator.ternary",
),
end_pattern: newPattern(
match: /:/,
tag_as: "keyword.operator.ternary",
),
applyEndPatternLast: true,
endCaptures: {
"0" => {
name: "keyword.operator.ternary.c"
}
},
patterns: [
{
include: "#method_access"
},
{
include: "#member_access"
},
{
include: "#c_function_call"
},
{
include: "$base"
}
]
}
includes: [ "#function-call-innards" ]

).to_tag,
]
},
"strings" => {
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/c.tmLanguage.json

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions syntaxes/c.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,20 +475,16 @@
:name: keyword.operator.assignment.c
- :match: "%|\\*|/|-|\\+"
:name: keyword.operator.c
- :begin: "\\?"
- :begin: "(\\?)"
:beginCaptures:
'0':
'1':
:name: keyword.operator.ternary.c
:end: ":"
:applyEndPatternLast: true
:end: "(:)"
:endCaptures:
'0':
'1':
:name: keyword.operator.ternary.c
:patterns:
- :include: "#method_access"
- :include: "#member_access"
- :include: "#c_function_call"
- :include: "$base"
- :include: "#function-call-innards"
strings:
:patterns:
- :begin: "\""
Expand Down

0 comments on commit f2c6a86

Please sign in to comment.