mirror of
https://github.com/robonen/questlang.git
synced 2026-03-20 02:44:47 +00:00
feat: implement module system with imports and exports support
This commit is contained in:
@@ -6,6 +6,12 @@
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#module-declaration"
|
||||
},
|
||||
{
|
||||
"include": "#import-declaration"
|
||||
},
|
||||
{
|
||||
"include": "#quest-declaration"
|
||||
},
|
||||
@@ -27,11 +33,42 @@
|
||||
{
|
||||
"include": "#identifiers"
|
||||
},
|
||||
{
|
||||
"include": "#module-reference"
|
||||
},
|
||||
{
|
||||
"include": "#punctuation"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"module-declaration": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(модуль)\\s+([а-яёА-ЯЁa-zA-Z_][а-яёА-ЯЁa-zA-Z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.control.module.questlang" },
|
||||
"2": { "name": "entity.name.namespace.module.questlang" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"import-declaration": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(импорт)\\s+([а-яёА-ЯЁa-zA-Z_][а-яёА-ЯЁa-zA-Z0-9_]*)\\s+(из)\\s+(\")",
|
||||
"end": "\"",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.control.import.questlang" },
|
||||
"2": { "name": "entity.name.namespace.import.questlang" },
|
||||
"3": { "name": "keyword.control.from.questlang" },
|
||||
"4": { "name": "punctuation.definition.string.begin.questlang" }
|
||||
},
|
||||
"endCaptures": { "0": { "name": "punctuation.definition.string.end.questlang" } },
|
||||
"contentName": "string.quoted.double.path.questlang",
|
||||
"patterns": [{ "match": "\\\\.", "name": "constant.character.escape.questlang" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
"comments": {
|
||||
"patterns": [
|
||||
{
|
||||
@@ -93,7 +130,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.control.structure.questlang",
|
||||
"match": "\\b(граф|узлы|начало|конец)\\b"
|
||||
"match": "\\b(граф|узлы|начало|конец|модуль|импорт|экспорт|из)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.other.property.questlang",
|
||||
@@ -105,6 +142,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"module-reference": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.type.module.reference.questlang",
|
||||
"match": "@([а-яёА-ЯЁa-zA-Z_][а-яёА-ЯЁa-zA-Z0-9_]*)\\.([а-яёА-ЯЁa-zA-Z_][а-яёА-ЯЁa-zA-Z0-9_]*)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"strings": {
|
||||
"patterns": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user