Пример #1
0
 public void CharRangeLiteralToSem()
 {
     var lowerAlpha = new CharRangeLiteral('a','z');
     var sem = lowerAlpha.ToSemanticNode();
     sem.Type.Is("char");
     sem.Begin.Is('a');
     sem.End.Is('z');
 }
Пример #2
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();
 }