/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0-alpha-1
src/OneScript.Language/LexicalAnalysis/DefaultLexer.cs
39 строк
1 KB
Andrei Ovsiankin
Поменял направления зависимостей у лексеров
12 янв 2021, 15:31
12 янв 2021, 15:31
b676467
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 OneScript.Language.SyntaxAnalysis; namespace OneScript.Language.LexicalAnalysis { public class DefaultLexer : FullSourceLexer, ILexemGenerator { private string _code; public override Lexem NextLexem() { Lexem lex; while((lex = base.NextLexem()).Type == LexemType.Comment) ; // skip return lex; } public int CurrentColumn => Iterator.CurrentColumn; public int CurrentLine => Iterator.CurrentLine; public string Code { get => _code; set { _code = value; Iterator = new SourceCodeIterator(value); } } } }