/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.Language/LexicalAnalysis/AnnotationLexerState.cs
30 строк
1 KB
EvilBeaver
Замечания сонара по полям классов
26 окт 2023, 11:52
26 окт 2023, 11:52
8e7bacf
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 class AnnotationLexerState : LexerState { const string MESSAGE_ANNOTATION_EXPECTED = "Ожидается имя аннотации"; private readonly WordLexerState _wordExtractor = new WordLexerState(); public override Lexem ReadNextLexem(SourceCodeIterator iterator) { iterator.MoveNext(); if (!iterator.MoveToContent()) throw CreateExceptionOnCurrentLine(MESSAGE_ANNOTATION_EXPECTED, iterator); if (!char.IsLetter(iterator.CurrentSymbol)) throw CreateExceptionOnCurrentLine(MESSAGE_ANNOTATION_EXPECTED, iterator); var lexem = _wordExtractor.ReadNextLexem(iterator); lexem.Type = LexemType.Annotation; return lexem; } } }