-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1c-query.sublime-syntax
62 lines (62 loc) · 4.19 KB
/
1c-query.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: "1C (Query)"
file_extensions:
- sdbl
- query
first_line_match: (?i)Выбрать|Select(\s+Разрешенные|\s+Allowed)?(\s+Различные|\s+Distinct)?(\s+Первые|\s+Top)?.*
scope: source.sdbl
contexts:
main:
- match: (^\s*//.*$)
scope: comment.line.double-slash.sdbl
- match: //
push:
- meta_scope: comment.line.double-slash.sdbl
- match: $
pop: true
- match: \"
push:
- meta_scope: string.quoted.double.sdbl
- match: '\"(?![\"])'
pop: true
- match: \"\"
scope: constant.character.escape.sdbl
- match: (^\s*//.*$)
scope: comment.line.double-slash.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Неопределено|Undefined|Истина|True|Ложь|False|NULL)(?=[^\wа-яё\.]|$)'
scope: constant.language.sdbl
- match: '(?<=[^\wа-яё\.]|^)(\d+\.?\d*)(?=[^\wа-яё\.]|$)'
scope: constant.numeric.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Выбор|Case|Когда|When|Тогда|Then|Иначе|Else|Конец|End)(?=[^\wа-яё\.]|$)'
scope: keyword.control.conditional.sdbl
- match: '(?i)(?<!КАК\s|AS\s)(?<=[^\wа-яё\.]|^)(НЕ|NOT|И|AND|ИЛИ|OR|В\s+ИЕРАРХИИ|IN\s+HIERARCHY|В|In|Между|Between|Есть(\s+НЕ)?\s+NULL|Is(\s+NOT)?\s+NULL|Ссылка|Refs|Подобно|Like)(?=[^\wа-яё\.]|$)'
scope: keyword.operator.logical.sdbl
- match: <=|>=|=|<|>
scope: keyword.operator.comparison.sdbl
- match: (\+|-|\*|/|%)
scope: keyword.operator.arithmetic.sdbl
- match: (,|;)
scope: keyword.operator.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Выбрать|Select|Разрешенные|Allowed|Различные|Distinct|Первые|Top|Как|As|ПустаяТаблица|EpmtyTable|Поместить|Into|Уничтожить|Drop|Из|From|((Левое|Left|Правое|Right|Полное|Full)\s+(Внешнее\s+|Outer\s+)?Соединение|Join)|((Внутреннее|Inner)\s+Соединение|Join)|Где|Where|(Сгруппировать\s+По)|(Group\s+By)|Имеющие|Having|Объединить(\s+Все)?|Union(\s+All)?|(Упорядочить\s+По)|(Order\s+By)|Автоупорядочивание|Autoorder|Итоги|Totals|По(\s+Общие)?|By(\s+Overall)?|(Только\s+)?Иерархия|(Only\s+)?Hierarchy|Периодами|Periods|Индексировать|Index|Выразить|Cast|Возр|Asc|Убыв|Desc|Для\s+Изменения|(For\s+Update(\s+Of)?)|Спецсимвол|Escape)(?=[^\wа-яё\.]|$)'
scope: keyword.control.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Значение|Value|ДатаВремя|DateTime|Тип|Type)(?=\()'
comment: Функции языка запросов
scope: support.function.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Подстрока|Substring)(?=\()'
comment: Функции работы со строками
scope: support.function.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Год|Year|Квартал|Quarter|Месяц|Month|ДеньГода|DayOfYear|День|Day|Неделя|Week|ДеньНедели|Weekday|Час|Hour|Минута|Minute|Секунда|Second|НачалоПериода|BeginOfPeriod|КонецПериода|EndOfPeriod|ДобавитьКДате|DateAdd|РазностьДат|DateDiff)(?=\()'
comment: Функции работы с датами
scope: support.function.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(Сумма|Sum|Среднее|Avg|Минимум|Min|Максимум|Max|Количество|Count)(?=\()'
comment: Агрегатные функции
scope: support.function.sdbl
- match: '(?i)(?<=[^\wа-яё\.]|^)(ЕстьNULL|IsNULL|Представление|Presentation|ПредставлениеСсылки|RefPresentation|ТипЗначения|ValueType)(?=\()'
comment: Прочие функции
scope: support.function.sdbl
- match: '(?i)(?<=[^\wа-яё\.])(Число|Number|Строка|String|Дата|Date)(?=[^\wа-яё\.]|$)'
scope: support.type.sdbl
- match: '(&[\wа-яё]+)'
scope: variable.parameter.sdbl