Example #1
0
 public void ConcatSingleMeny()
 {
     var lowerAlpha = new CharRangeLiteral('a', 'z');
     var next = new Many(
         new Alternative(new List<SyntaxNode>
             {
                 new CharRangeLiteral('a', 'z'),
                 new CharRangeLiteral('A', 'Z')
             } ));
     var concat = new Concat(new List<SyntaxNode> {lowerAlpha, next});
     var sem = concat.ToSemanticNode();
     sem.IsNotNull();
     sem.Nodes[0].Type.Is("char");
     sem.Nodes[1].Type.Is("IList<char>");
     sem.Type.IsNull();
 }
Example #2
0
        public void NameRefTypePropergationWithNotFound()
        {
            var hogeDecl = new Declare("THoge", "hoge", null);
            var hageDecl = new Declare("THage", "hage", null);
            var decls = new[] { hogeDecl, hageDecl };

            SemanticProcessor.Initialize(decls.ToDictionary(decl => decl.Name));
            var concat = new Concat(new List<SyntaxNode>
                {
                    new NameReference("moge"),
                    new NameReference("page")
                });
            var sem = concat.ToSemanticNode();
            sem.IsNotNull();
            sem.Nodes[0].Type.IsNull();
            sem.Nodes[1].Type.IsNull();
        }