Skip to content

Commit

Permalink
Merge pull request #26 from atf1206/minor_syntax_update
Browse files Browse the repository at this point in the history
Fix underscore highlighting
  • Loading branch information
komsit37 authored Jun 24, 2020
2 parents a3be63c + 540c89c commit 2f10049
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions syntax/q.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
<key>name</key>
<string>other.assignment.q</string>
<key>match</key>
<string>(?=([^a-zA-Z0-9]|\b))([a-zA-Z]+[a-zA-Z0-9_]*)\s*([,+\-*%@$!?&lt;&gt;=~|&amp;\#]?)(::|:)</string>
<string>(?&lt;=([^a-zA-Z0-9])|(?&lt;=\b))([a-zA-Z]+[a-zA-Z0-9_]*)\s*([,+\-*%@$!?&lt;&gt;=~|&amp;\#]?)(::|:)</string>
<!-- <string>(?=([^a-zA-Z0-9]|\b))(\.?[a-zA-Z]+[a-zA-Z0-9_]*)(\.[a-zA-Z0-9_]*)*\s*([,+\-*%@$!?&lt;&gt;=~|&amp;\#]?)(::|:)\s*</string> -->
<key>captures</key>
<dict>
Expand Down Expand Up @@ -384,7 +384,7 @@
<key>name</key>
<string>constant.numeric.complex.q</string>
<key>match</key>
<string>(?=(\W|\b))([-]?[0-9]+[bhijf]?(\.[0-9]+[m]?)?|0x[a-fA-F0-9]+)(?=(\W|\b)|_)</string>
<string>((?&lt;=(\W))|(?&lt;=_)|(?&lt;=\b))([-]?[0-9]+[bhijf]?(\.[0-9]+[m]?)?|0x[a-fA-F0-9]+)(?=(\W|\b)|_)</string>
</dict>

<!-- real (8) -->
Expand All @@ -394,7 +394,7 @@
<key>name</key>
<string>constant.numeric.complex.real.q</string>
<key>match</key>
<string>(?=(\W|\b))([-]?[0-9]+e[-]?[0-9]+)(?=(\W|\b))</string>
<string>((?&lt;=\W)|(?&lt;=_)|(?&lt;=\b))([-]?[0-9]+e[-]?[0-9]+)(?=(\W|\b))</string>
</dict>

<!-- nulls -->
Expand All @@ -404,7 +404,7 @@
<key>name</key>
<string>constant.numeric.complex.null.q</string>
<key>match</key>
<string>(?=(\W|\b))(0n|0N[ghijepmdznuvt]?)(?=(\W|\b))</string>
<string>((?&lt;=\W)|(?&lt;=_)|(?&lt;=\b))(0n|0N[ghijepmdznuvt]?)(?=(\W|\b))</string>
</dict>

<!-- infinities -->
Expand All @@ -414,7 +414,7 @@
<key>name</key>
<string>constant.numeric.complex.inf.q</string>
<key>match</key>
<string>(?=(\W|\b))(0w|0W[hijepdznuvt]?)(?=(\W|\b))</string>
<string>((?&lt;=\W)|(?&lt;=_)|(?&lt;=\b))(0w|0W[hijepdznuvt]?)(?=(\W|\b))</string>
</dict>

<!-- Various operators -->
Expand All @@ -424,7 +424,7 @@
<key>name</key>
<string>support.function.q</string>
<key>match</key>
<string>[!$@\\/_#?|',`\\:]</string>
<string>[!$@\\/#?|',`\\:]</string>
</dict>
<dict>
<key>comment</key>
Expand All @@ -434,6 +434,22 @@
<key>match</key>
<string>\.(?=\W)</string>
</dict>
<dict>
<key>comment</key>
<string>placeholder for variable names with underscores</string>
<key>name</key>
<string>source.q</string>
<key>match</key>
<string>[a-zA-Z][a-zA-Z0-9_]+</string>
</dict>
<dict>
<key>comment</key>
<string>drop (underscore)</string>
<key>name</key>
<string>support.function.q</string>
<key>match</key>
<string>(?&lt;=[0-9\s])_</string>
</dict>

</array>

Expand Down

0 comments on commit 2f10049

Please sign in to comment.