-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add:
moot-lang
, VSCode syntax highlighting for .moor
- Loading branch information
Showing
7 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ comments: | |
excludes: | ||
- \.gitignore | ||
- \.gitmodules | ||
- \.vscodeignore | ||
- .*lock | ||
- \.git/.* | ||
- \.idea/.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
.gitignore | ||
vsc-extension-quickstart.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# moot-lang README | ||
|
||
Very simple VSCode syntax highlighting extension for `.moot` test files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"comments": { | ||
"lineComment": "//", | ||
}, | ||
"brackets": [ | ||
[ | ||
"{", | ||
"}" | ||
], | ||
[ | ||
"[", | ||
"]" | ||
], | ||
[ | ||
"(", | ||
")" | ||
] | ||
], | ||
"autoClosingPairs": [ | ||
[ | ||
"{", | ||
"}" | ||
], | ||
[ | ||
"[", | ||
"]" | ||
], | ||
[ | ||
"(", | ||
")" | ||
], | ||
[ | ||
"\"", | ||
"\"" | ||
], | ||
[ | ||
"`", | ||
"'" | ||
] | ||
], | ||
"surroundingPairs": [ | ||
[ | ||
"{", | ||
"}" | ||
], | ||
[ | ||
"[", | ||
"]" | ||
], | ||
[ | ||
"(", | ||
")" | ||
], | ||
[ | ||
"\"", | ||
"\"" | ||
], | ||
[ | ||
"`", | ||
"'" | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "moot-lang", | ||
"displayName": "moot-lang", | ||
"description": "Syntax highlighting for .moot test files", | ||
"version": "0.0.1", | ||
"engines": { | ||
"vscode": "^1.92.0" | ||
}, | ||
"categories": [ | ||
"Programming Languages" | ||
], | ||
"contributes": { | ||
"languages": [{ | ||
"id": "moot", | ||
"aliases": ["moot", "moot"], | ||
"extensions": [".moot"], | ||
"configuration": "./language-configuration.json" | ||
}], | ||
"grammars": [{ | ||
"language": "moot", | ||
"scopeName": "source.moot", | ||
"path": "./syntaxes/moot.tmLanguage.json" | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "moot", | ||
"patterns": [ | ||
{ | ||
"include": "#constants" | ||
}, | ||
{ | ||
"include": "#variables" | ||
}, | ||
{ | ||
"include": "#directives" | ||
}, | ||
{ | ||
"include": "#keywords" | ||
}, | ||
{ | ||
"include": "#strings" | ||
}, | ||
{ | ||
"include": "#comments" | ||
} | ||
], | ||
"repository": { | ||
"constants": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.numeric.moo", | ||
"match": "\\b[0-9]+\\.?[0-9]*([eE][+-]?[0-9]+)?\\b" | ||
}, | ||
{ | ||
"name": "variable.language.moo", | ||
"match": "\\b(INT|NUM|FLOAT|LIST|MAP|STR|ANON|OBJ|ERR|player|this|caller|verb|args|argstr|dobj|dobjstr|prepstr|iobj|iobjstr)\\b" | ||
}, | ||
{ | ||
"name": "constant.language.moo.error", | ||
"match": "\\b(E_NONE|E_TYPE|E_DIV|E_PERM|E_PROPNF|E_VERBNF|E_VARNF|E_INVIND|E_RECMOVE|E_MAXREC|E_RANGE|E_ARGS|E_NACC|E_INVARG|E_QUOTA|E_FLOAT)\\b" | ||
} | ||
] | ||
}, | ||
"variables": { | ||
"patterns": [ | ||
{ | ||
"name": "variable.other.moo.object", | ||
"match": "#-?[0-9]+\\b" | ||
}, | ||
{ | ||
"name": "support.variable.moo", | ||
"match": "\\$(nothing|ambiguous_match|failed_match|system)" | ||
}, | ||
{ | ||
"name": "variable.other.moo.corified", | ||
"match": "\\$\\w+\\b" | ||
} | ||
] | ||
}, | ||
"directives": { | ||
"patterns": [ | ||
{ | ||
"name": "markup.heading.moot.userselect", | ||
"match": "^@.*" | ||
}, | ||
{ | ||
"name": "markup.inserted.moot.input", | ||
"match": "^[;%>]" | ||
}, | ||
{ | ||
"name": "markup.inline.raw.moot.output", | ||
"match": "^=.*" | ||
} | ||
] | ||
}, | ||
"comments": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.line.double-slash.moot", | ||
"match": "//.*" | ||
} | ||
] | ||
}, | ||
"keywords": { | ||
"patterns": [ | ||
{ | ||
"name": "keyword.control.moo", | ||
"match": "\\b(if|while|for|return|endif|endwhile|endfor|else|elseif|in|this|try|except|finally|endtry|ANY)\\b" | ||
}, | ||
{ | ||
"name": "support.function.moor.builtins", | ||
"match": "\\b(abs|acos|add_property|add_verb|asin|atan|b|binary_hash|boot_player|buffered_output_length|c|call_function|caller_perms|callers|ceil|children|chparent|clear_property|connected_players|connected_seconds|connection_name|connection_option|connection_options|cos|cosh|create|crypt|ctime|d|db_disk_size|decode_binary|delete_property|delete_verb|disassemble|dump_database|e|encode_binary|equal|eval|exp|f|floatstr|floor|flush_input|force_input|function_info|i|idle_seconds|index|is_clear_property|is_member|is_player|k|kill_task|l|length|listappend|listdelete|listen|listeners|listinsert|listset|log|log10|m|match|max|max_object|memory_usage|min|move|n|notify|o|object_bytes|open_network_connection|output_delimiters|p|parent|pass|players|properties|property_info|q|queue_info|queued_tasks|r|raise|random|read|recycle|renumber|reset_max_object|resume|rindex|rmatch|s|seconds_left|server_log|server_version|set_connection_option|set_player_flag|set_property_info|set_task_perms|set_verb_args|set_verb_code|set_verb_info|setadd|setremove|shutdown|sin|sinh|sqrt|strcmp|string_hash|strsub|substitute|suspend|t|tan|tanh|task_id|task_stack|ticks_left|time|tofloat|toint|toliteral|tonum|toobj|tostr|trunc|typeof|u|unlisten|v|valid|value_bytes|value_hash|verb_args|verb_code|verb_info|verbs)\\b" | ||
} | ||
] | ||
}, | ||
"strings": { | ||
"name": "string.quoted.double.moot", | ||
"begin": "\"", | ||
"end": "\"", | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.moot", | ||
"match": "\\\\." | ||
} | ||
] | ||
} | ||
}, | ||
"scopeName": "source.moot" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Welcome to your VS Code Extension | ||
|
||
## What's in the folder | ||
|
||
* This folder contains all of the files necessary for your extension. | ||
* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. | ||
* `syntaxes/moot.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. | ||
* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. | ||
|
||
## Get up and running straight away | ||
|
||
* Make sure the language configuration settings in `language-configuration.json` are accurate. | ||
* Press `F5` to open a new window with your extension loaded. | ||
* Create a new file with a file name suffix matching your language. | ||
* Verify that syntax highlighting works and that the language configuration settings are working. | ||
|
||
## Make changes | ||
|
||
* You can relaunch the extension from the debug toolbar after making changes to the files listed above. | ||
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. | ||
|
||
## Add more language features | ||
|
||
* To add features such as IntelliSense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs | ||
|
||
## Install your extension | ||
|
||
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code. | ||
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. |