/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.Language/SyntaxAnalysis/AstNodes/AnnotatableNode.cs
32 строки
965 B
Andrey Ovsiankin
Импорты компилируются, как аннотации к модулю
07 дек 2020, 17:53
07 дек 2020, 17:53
db693a7
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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.Collections.Generic; namespace OneScript.Language.SyntaxAnalysis.AstNodes { public class AnnotatableNode : NonTerminalNode { protected AnnotatableNode() { } public AnnotatableNode(NodeKind kind) : base(kind) { } private List<AnnotationNode> AnnotationsList { get; } = new List<AnnotationNode>(); public IEnumerable<AnnotationNode> Annotations => AnnotationsList; protected override void OnChildAdded(BslSyntaxNode child) { if(child is AnnotationNode anno) AnnotationsList.Add(anno); } } }