Skip to content

Commit

Permalink
[TCL] Fix implementation of curly brace quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Apr 23, 2016
1 parent b0fdac1 commit f893296
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TCL/Tcl.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ contexts:
- include: regexp
- include: escape
- include: variable
- include: braces
- match: '"'
scope: punctuation.definition.string.begin.tcl
push:
Expand All @@ -73,6 +74,7 @@ contexts:
- match: '(?:^|(?<=\s))\{'
comment: matches a single brace-enclosed word
push:
- meta_scope: string.quoted.curly.tcl
- match: '\}([^\s\]]*)'
captures:
1: invalid.illegal.tcl
Expand Down
15 changes: 15 additions & 0 deletions TCL/syntax_test_tcl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,23 @@ puts "Not Highlighting"
# Issue 131: https://github.com/SublimeTextIssues/DefaultPackages/issues/131
# -------------------------------------------------------------------------- #
set ok1 {["]"]}
# ^^^^^^^ string.quoted.curly
set ok2 {["][]"]}
# ^^^^^^^^^ string.quoted.curly
set not_ok {["]["]}
# ^^^^^^^^ string.quoted.curly
puts $ok1 ;# ["]"]
# ^ keyword.other
# ^^^^ variable.other
# ^ punctuation.definition.variable
# ^ comment.line
puts $ok2 ;# ["][]"]
# ^ keyword.other
# ^^^^ variable.other
# ^ punctuation.definition.variable
# ^ comment.line
puts $not_ok ;# ["]["]
# ^ keyword.other
# ^^^^^^^ variable.other
# ^ punctuation.definition.variable
# ^ comment.line

0 comments on commit f893296

Please sign in to comment.