feat: implement module system with imports and exports support

This commit is contained in:
2025-11-15 19:03:36 +07:00
parent 3a0f152c6e
commit 69ea8329e9
14 changed files with 623 additions and 30 deletions

View File

@@ -10,11 +10,14 @@ VS Code extension for syntax highlighting of QuestLang - a specialized language
- 🎨 **Color highlighting for strings and numbers**
- 🔧 **Automatic bracket closing**
- 📐 **Automatic indentation**
- 📦 **Modules and imports** (`модуль`, `импорт`, `экспорт`, `из`)
- 🧭 **Cross-module references** `@Модуль.узел`
## Supported Language Elements
### Keywords
- `квест`, `цель`, `граф`, `узлы`, `начало`, `конец`
- `модуль`, `импорт`, `экспорт`, `из`
- `тип`, `описание`, `переходы`, `варианты`, `название`
- `начальный`, `действие`, `концовка`
@@ -28,23 +31,30 @@ VS Code extension for syntax highlighting of QuestLang - a specialized language
## Code Example
```questlang
квест MyQuest;
цель "Quest objective description";
модуль Локации;
узлы {
лес: { тип: концовка; название: "Лес"; описание: "Вы в лесу"; }
}
экспорт [лес];
квест МойКвест;
цель "Описание цели квеста";
импорт Локации из "./locations.ql";
граф {
узлы {
старт: {
тип: начальный;
описание: "Beginning of the adventure";
описание: "Начало приключения";
переходы: [выбор];
}
выбор: {
тип: действие;
описание: "What will you do?";
описание: "Что вы будете делать?";
варианты: [
("Go right", правый_путь),
("Go left", левый_путь)
("Идти в лес", @Локации.лес)
];
}
}