Skip to content

Commit

Permalink
Fixed #1 an issue with strings not being greedy enough.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eforen committed Nov 23, 2015
1 parent 6c8b7bc commit 3263c86
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 57 deletions.
19 changes: 5 additions & 14 deletions sprak.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,10 @@ patterns:

- comment: String, double-quoted
name: string.quoted.double.sprak
begin: (")
beginCaptures:
'1': { name: punctuation.definition.string.begin.sprak }
end: (")
endCaptures:
'1': { name: punctuation.definition.string.begin.sprak }
patterns:
- comment: Escaped double-quote inside double-quoted string
name: constant.character.escape.sprak
match: (\\")
- comment: Single quote inside double-quoted string
name: other.sprak
match: (')
- include: $self
match: \"[^"]*\"

- comment: String, single-quoted
name: string.quoted.single.sprak
match: \'[^']*\'

...
53 changes: 10 additions & 43 deletions sprak.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -132,53 +132,20 @@
</array>
</dict>
<dict>
<key>begin</key>
<string>(")</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sprak</string>
</dict>
</dict>
<key>comment</key>
<string>String, double-quoted</string>
<key>end</key>
<string>(")</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sprak</string>
</dict>
</dict>
<key>match</key>
<string>\"[^"]*\"</string>
<key>name</key>
<string>string.quoted.double.sprak</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>Escaped double-quote inside double-quoted string</string>
<key>match</key>
<string>(\\")</string>
<key>name</key>
<string>constant.character.escape.sprak</string>
</dict>
<dict>
<key>comment</key>
<string>Single quote inside double-quoted string</string>
<key>match</key>
<string>(')</string>
<key>name</key>
<string>other.sprak</string>
</dict>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<dict>
<key>comment</key>
<string>String, single-quoted</string>
<key>match</key>
<string>\'[^']*\'</string>
<key>name</key>
<string>string.quoted.single.sprak</string>
</dict>
</array>
<key>scopeName</key>
Expand Down

0 comments on commit 3263c86

Please sign in to comment.