Пример #1
0
        public static IList <Field> GetFields(
            this ForClause forClause,
            ILogger logger,
            SchemaFile file
            )
        {
            switch (forClause)
            {
            case XmlForClause xmlForClause:
                return(new List <Field>()
                {
                    new DefaultField()
                    {
                        Name = null,
                        Type = FieldType.Xml,
                        Origin = OriginType.ForClause,
                        IsNullable = false,
                    }
                });

            case JsonForClause jsonForClause:
                return(new List <Field>()
                {
                    new DefaultField()
                    {
                        Name = null,
                        Type = FieldType.Json,
                        Origin = OriginType.ForClause,
                        IsNullable = false,
                    }
                });

            default:
                logger.Log(LogLevel.Warning,
                           LogType.NotSupportedYet,
                           file.Path,
                           $"\"{forClause.GetType()}\" for clause is not supported yet. " +
                           $"Fragment: {forClause.GetTokenText()}");

                return(new List <Field>()
                {
                    new UnknownField()
                    {
                        Name = null,
                        Origin = OriginType.ForClause,
                    }
                });
            }
        }
Пример #2
0
Файл: AST.cs Проект: stroan/Lamn
 public ForStatement(ForClause clause, Chunk block)
 {
     Clause = clause;
     Block = block;
 }
 public override void ExplicitVisit(ForClause fragment)
 {
     _fragments.Add(fragment);
 }
 public sealed override void ExplicitVisit(ForClause node)
 {
     base.ExplicitVisit(node);
 }
 public sealed override void Visit(ForClause node)
 {
     base.Visit(node);
 }
Пример #6
0
 public override void ExplicitVisit(ForClause node) { this.action(node); }