/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.Language/SpecialChars.cs
55 строк
2 KB
Andrei Ovsiankin
Лексер для меток
19 окт 2023, 11:08
19 окт 2023, 11:08
8fa327f
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; namespace OneScript.Language { public static class SpecialChars { public const char StringQuote = '"'; public const char DateQuote = '\''; public const char EndOperator = ';'; public const char Underscore = '_'; public const char QuestionMark = '?'; public const char Preprocessor = '#'; public const char Annotation = '&'; public const char Tilde = '~'; public const char Colon = ':'; public static bool IsOperatorChar(char symbol) { switch (symbol) { case '+': case '-': case '*': case '/': case '<': case '>': case '=': case '%': case '(': case ')': case '.': case ',': case '[': case ']': return true; default: return false; } } public static bool IsDelimiter(char symbol) { return !(Char.IsLetterOrDigit(symbol) || symbol == Underscore); } } }