-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TextMate grammar (used by Visual Studio Code)
Based on Corey Harris's grammar: https://github.com/coreysharris/vscode-macaulay2/blob/master/syntaxes/macaulay2.tmLanguage.json
- Loading branch information
1 parent
a7a2f1f
commit 2f774ce
Showing
2 changed files
with
115 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
106 changes: 106 additions & 0 deletions
106
M2/Macaulay2/editors/textmate/macaulay2.tmLanguage.json.in
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 @@ | ||
{ | ||
"name": "Macaulay2", | ||
"scopeName": "source.macaulay2", | ||
"fileTypes": [ | ||
"m2" | ||
], | ||
"patterns": [ | ||
{ | ||
"include": "#comments" | ||
}, | ||
{ | ||
"include": "#strings" | ||
}, | ||
{ | ||
"include": "#keywords" | ||
}, | ||
{ | ||
"include": "#support" | ||
} | ||
], | ||
"repository": { | ||
"storage": { | ||
"patterns": [ | ||
{ | ||
"name": "meta.function.macaulay2", | ||
"match": "(\\)" | ||
} | ||
] | ||
}, | ||
"keywords": { | ||
"patterns": [ | ||
{ | ||
"name": "keyword.other.macaulay2", | ||
"match": "(x?)\\b(@M2KEYWORDS@)\\b" | ||
}, | ||
{ | ||
"name": "keyword.operator.functionArrow.macaulay2", | ||
"match": "->" | ||
}, | ||
{ | ||
"name": "keyword.operator.optionArrow.macaulay2", | ||
"match": "=>" | ||
}, | ||
{ | ||
"name": "keyword.operator.arithmetic.macaulay2", | ||
"match": "%|\\*|/|//|-|\\+|\\\\" | ||
} | ||
] | ||
}, | ||
"strings": { | ||
"patterns": [ | ||
{ | ||
"name": "string.quoted.double.macaulay2", | ||
"begin": "\"", | ||
"end": "\"", | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.macaulay2", | ||
"match": "\\\\." | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "string.tripleslash.macaulay2", | ||
"begin": "///", | ||
"end": "///" | ||
} | ||
] | ||
}, | ||
"comments": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.line.double-dash.macaulay2", | ||
"begin": "--", | ||
"end": "$" | ||
}, | ||
{ | ||
"name": "comment.block.macaulay2", | ||
"begin": "-\\*", | ||
"end": "\\*-" | ||
}, | ||
{ | ||
"name": "comment.block.macaulay2.deprecated", | ||
"begin": "{\\*", | ||
"end": "\\*}" | ||
} | ||
] | ||
}, | ||
"support": { | ||
"patterns": [ | ||
{ | ||
"name": "entity.name.type.macaulay2", | ||
"match": "(x?)\\b(@M2DATATYPES@)\\b" | ||
}, | ||
{ | ||
"name": "support.function.macaulay2", | ||
"match": "(x?)\\b(@M2FUNCTIONS@)\\b" | ||
}, | ||
{ | ||
"name": "constant.language.macaulay2", | ||
"match": "(x?)\\b(@M2CONSTANTS@)\\b" | ||
} | ||
] | ||
} | ||
} | ||
} |