Skip to content

Commit

Permalink
[YAML] Fix lexing to not interpret unquoted values with colons as keys
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Mar 30, 2016
1 parent c1ebade commit c52dd91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions YAML/YAML.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ contexts:
| \s+ (?![#\s])
)*
\s*
:
:\s
)
push:
# TODO Use a merge type here and add "pop: true" and "scope: entity.name.tag.yaml";
Expand Down Expand Up @@ -514,7 +514,7 @@ contexts:
| \s+ (?![#\s])
)*
\s*
:
:\s
)
push:
- include: flow-scalar-plain-out-implicit-type
Expand Down
21 changes: 11 additions & 10 deletions YAML/tests/syntax_test_flow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,17 @@ continuation"
#^^^^^ variable.other.alias
# ^ meta.flow-sequence punctuation.definition.sequence.end

[a: b, c,'d', e: f, ]
#^ meta.flow-pair.key string.unquoted.plain.in entity.name.tag
# ^ meta.flow-pair punctuation.separator.mapping.key-value -meta.flow-pair.value
# ^ meta.flow-pair.value string.unquoted.plain.in -entity.name.tag
# ^ string.unquoted.plain.in
# ^ punctuation.separator.sequence
# ^^^ string.quoted.single
# ^ string.unquoted.plain.in entity.name.tag
# ^ punctuation.separator.mapping.key-value
# ^ punctuation.separator.sequence
[a: b, c,'d', e: f, g:h]
#^ meta.flow-pair.key string.unquoted.plain.in entity.name.tag
# ^ meta.flow-pair punctuation.separator.mapping.key-value -meta.flow-pair.value
# ^ meta.flow-pair.value string.unquoted.plain.in -entity.name.tag
# ^ string.unquoted.plain.in
# ^ punctuation.separator.sequence
# ^^^ string.quoted.single
# ^ string.unquoted.plain.in entity.name.tag
# ^ punctuation.separator.mapping.key-value
# ^ punctuation.separator.sequence
# ^^^ string.unquoted.plain.in


##############################################################################
Expand Down

0 comments on commit c52dd91

Please sign in to comment.