Malical syntax highlighting for GNU nano editor
Posté le 11/07/2023 20:41
While I don't know how many of you are still programming in Malical
and how many are using nano editor to do it, I thought it can't hurt to share my syntax file
Following instructions are for Linux, don't know exactly how but I'm sure you can apply it for nano running under Windows...
To use it just create a file named "malical.nanorc" in your local .nano folder, where other syntax files usually reside, with the following content:
syntax "Malical" "\.mcl"
color red "\<(var)\>"
## Control structures
color brightcyan "\<(if|while|else|end)\>"
## Defined functions
color brightblue "::.*"
color brightblue "\<(return)\>"
## Library functions
color orange "\<(sin|cos|tan|atn|int|abs|rand|val|tos|chr|asc|mid|len|type|eval|locate|print|printrev|printxy|printmini|printnum|printnumxy|printnummini|gets|getkey|iskeydown|line|box|circle|allclr|areaclr|lineclr|arearev|setpoint|getpoint|putdisp|popupwin|savedisp|rcldisp|rclpict|push|delete|clear|sizeof|showap|rtcreset|setyear|setmonth|setdomonth|setdoweek|sethour|setminute|setsecond|readyear|readmonth|readdomonth|readdoweek|readhour|readminute|readsecond|exit|sleep|cpuspeed|waitkey)\>"
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
color gray "#.*"
Then add that syntax to your .nanorc file, like this:
Hope this helps, happy programming!
(Edit: moved the comments at the bottom of the file, now they work as they should)