Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax highlighting for output in sublime text 4 #32

Closed
kdevkr opened this issue Nov 2, 2021 · 2 comments
Closed

Fix syntax highlighting for output in sublime text 4 #32

kdevkr opened this issue Nov 2, 2021 · 2 comments

Comments

@kdevkr
Copy link
Contributor

kdevkr commented Nov 2, 2021

syntax highlighting error for temporal data in sublime text 4.

image

Solution: Copy code from q.tmLanuage to q_output.tmLanguage.

<!-- timestamp (12) -->
<dict>
	<key>comment</key>
	<string>timestamp</string>
	<key>name</key>
	<string>constant.numeric.complex.timestamp.q</string>
	<key>match</key>
	<!-- For convenience, here are the disallowed chars: 1st group: DT, 2nd group: eTisDdfhjzbmc -->
	<string>(?=(\W|\b))([0-9]{4}\.[0-9]{2}\.[0-9]{2}D[0-9]{2}(:[0-5][0-9]){0,2}(\.[0-9]{3}([a-zA-CE-SU-Z0-9]*[ABCEFGHIJKLMNOPQRSUVWXYZagklnopqrtuvwxy0-9])?|\.[0-9]*|:)?)(?=(\W|\b))</string>
</dict>
<!-- datetime (15) -->
<dict>
	<key>comment</key>
	<string>datetime</string>
	<key>name</key>
	<string>constant.numeric.complex.datetime.q</string>
	<key>match</key>
	<!-- For convenience, here are the disallowed chars: 1st group: D, 2nd group: eTisDdfhjzbmc -->
	<string>(?=(\W|\b))([0-9]{4}\.[0-9]{2}\.[0-9]{2}T[0-9]{2}(:[0-5][0-9]){0,2}(\.[0-9]{3}([a-zA-CE-Z0-9]*[ABCEFGHIJKLMNOPQRSUVWXYZagklnopqrtuvwxy0-9])?|\.[0-9]*|:)?)(?=(\W|\b))</string>
</dict>
<!-- timespan (16) -->
<dict>
	<key>comment</key>
	<string>datetime and timespan</string>
	<key>name</key>
	<string>constant.numeric.complex.timespan.q</string>
	<key>match</key>
	<!-- For convenience, here are the disallowed chars: 1st group: eisdfhjzbm, 2nd group: eTisDdfhjzbmc -->
	<string>(?=(\W|\b))(([0-9]{1,6}D([0-9]{1,2})((:[0-5][0-9]){0,2}|:)(\.[0-9]{0,9}[a-zA-Z0-9]*[A-Zacgklnopqrtuvwxy0-9])?)|([0-9]{2}:[0-5][0-9](:[0-5][0-9]\.[0-9]{4,}|:[0-5][0-9]\.[0-9]{9,}[a-zA-Z0-9]*[ABCEFGHIJKLMNOPQRSUVWXYZagklnopqrtuvwxy0-9])|\.[0-9]{8,}))(?=(\W|\b))</string>
</dict>
<!-- time (19) -->
<dict>
	<key>comment</key>
	<string>time</string>
	<key>name</key>
	<string>constant.numeric.complex.time.q</string>
	<key>match</key>
	<!-- For convenience, here are the disallowed chars: eTisDdfhjzbm -->
	<string>(?=(\W|\b))([0-9]{2}:[0-5][0-9]((:[0-9]{2}(((([ABCEFGHIJKLMNOPQRSUVWXYZacgklnopqrtuvwxy0-9:]){1,2})?([0-5][0-9]){1,2})|\.[0-9]{3}[ABCEFGHIJKLMNOPQRSUVWXYZacgklnopqrtuvwxy0-9]?|\.[0-9]{0,3}))|\.[0-9]{4,7}))(?=(\W|\b))</string>
</dict>
<!-- second (18) -->
<dict>
	<key>comment</key>
	<string>second</string>
	<key>name</key>
	<string>constant.numeric.complex.second.q</string>
	<key>match</key>
	<string>(?=(\W|\b))([0-9]{2}:[0-5][0-9]([0-5][0-9]([0-5][0-9])?|\.[0-9]{2}|:[0-9]{2}|([a-zA-Z]){0,2}[0-5][0-9]))(?=(\W|\b))</string>
</dict>
<!-- minute (17) -->
<dict>
	<key>comment</key>
	<string>minute</string>
	<key>name</key>
	<string>constant.numeric.complex.minute.q</string>
	<key>match</key>
	<!-- For convenience, here are the disallowed chars: eTisDdfhjzbm -->
	<string>(?=(\W|\b))([0-9]{2}:([0-5][0-9]([ABCEFGHIJKLMNOPQRSUVWXYZacgklnopqrtuvwxy0-9:])?)?)(?=(\W|\b))</string>
</dict>
<!-- date (14) -->
<dict>
	<key>comment</key>
	<string>date</string>
	<key>name</key>
	<string>constant.numeric.complex.date.q</string>
	<key>match</key>
	<string>(?=(\W|\b))([0-9]{4}\.[0-9]{2}\.[0-9]{2})(?=(\W|\b))</string>
</dict>
<!-- month (13) -->
<dict>
	<key>comment</key>
	<string>month</string>
	<key>name</key>
	<string>constant.numeric.complex.month.q</string>
	<key>match</key>
	<string>(?=(\W|\b))([0-9]{4,}\.([0][1-9]|[1][0-2])m)(?=(\W|\b))</string>
</dict>
<!-- boolean (binary) (1), byte (4), short (5), int (6), long (7), float (9) -->
<dict>
	<key>comment</key>
	<string>boolean, byte, short, int, long, float</string>
	<key>name</key>
	<string>constant.numeric.complex.q</string>
	<key>match</key>
	<string>((?&lt;=(\W))|(?&lt;=_)|(?&lt;=\b))([-]?[0-9]+[bhijf]?(\.[0-9]+[m]?)?|0x[a-fA-F0-9]+)(?=(\W|\b)|_)</string>
</dict>

Output:

image

@komsit37
Copy link
Owner

Sorry for late reply. Looks good. Can you send pull request with the change?

@komsit37
Copy link
Owner

#33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants