/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.Language/LexicalAnalysis/LexerState.cs
29 строк
929 B
Andrei Ovsiankin
Переименовал CodePositionInfo в ErrorPositionInfo т.к. класс используется только для индикации ошибок в тексте
18 сен 2020, 17:03
18 сен 2020, 17:03
2fde60b
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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/. ----------------------------------------------------------*/ namespace OneScript.Language.LexicalAnalysis { public abstract class LexerState { abstract public Lexem ReadNextLexem(SourceCodeIterator iterator); public SyntaxErrorException CreateExceptionOnCurrentLine(string message, SourceCodeIterator iterator) { var cp = iterator.GetErrorPosition(); return new SyntaxErrorException(cp, message); } } internal class EmptyLexerState : LexerState { public override Lexem ReadNextLexem(SourceCodeIterator iterator) { return Lexem.Empty(); } } }