-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add MonkeyC syntax highlighting. #506
base: master
Are you sure you want to change the base?
Conversation
Add syntax highlighting for Garmins MonkeyC language https://developer.garmin.com/connect-iq/reference-guides/monkey-c-reference/
add the missing constants
Looks good; can you add the appropriate entry to |
Done, thanks - didn't catch that haha. |
-- operators | ||
["+"] = "operator", | ||
["-"] = "operator", | ||
["*"] = "operator", | ||
["/"] = "operator", | ||
["%"] = "operator", | ||
["++"] = "operator", | ||
["--"] = "operator", | ||
["=="] = "operator", | ||
["!="] = "operator", | ||
[">"] = "operator", | ||
["<"] = "operator", | ||
[">="] = "operator", | ||
["<="] = "operator", | ||
["&&"] = "operator", | ||
["||"] = "operator", | ||
["!"] = "operator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already covered by line 19, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me actually make this part regexless, you are right.
{ pattern = "-?%.?%d+", type = "number" }, | ||
{ pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, | ||
{ pattern = "[%a_][%w_]*%f[(]", type = "function" }, | ||
{ regex = "[A-Z][A-Z_]+", type = "keyword2" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to have this as regex, it can be exactly the same with pattern
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know that when I looked at language_java.lua haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, when using regex we should always use [[regex_pattern_here]]
instead of "regex_pattern_here"
.
@@ -125,6 +125,7 @@ | |||
"language_marte": {}, | |||
"language_meson": {}, | |||
"language_miniscript": {}, | |||
"language_monkeyc": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also bump the version of meta_languages
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta_languages in the manifest itself, yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
syntax.add { | ||
name = "MonkeyC", | ||
files = { "%.mc$", "%.mciq$" }, | ||
comment = "//", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment = "//", | |
comment = "//", | |
block_comment = { "/*", "*/" }, |
Add syntax highlighting for Garmins MonkeyC language