Exemple #1
0
 private static AstNode ParseList(TokenStream stream)
 {
     stream.Expect (TokenClass.OpenBracket);
     ListExpression ret = new ListExpression (stream.Location);
     while (!stream.Match (TokenClass.CloseBracket)) {
         AstNode expr = ParseExpression (stream);
         if (stream.Accept (TokenClass.Keyword, "for")) {
             string ident = stream.Expect (TokenClass.Identifier).Value;
             stream.Expect (TokenClass.Keyword, "in");
             AstNode iterator = ParseExpression (stream);
             AstNode predicate = null;
             if (stream.Accept (TokenClass.Keyword, "when")) {
                 predicate = ParseExpression (stream);
             }
             stream.Expect (TokenClass.CloseBracket);
             return new ListCompExpression (expr.Location, expr, ident, iterator, predicate);
         }
         ret.Add (expr);
         if (!stream.Accept (TokenClass.Comma)) {
             break;
         }
     }
     stream.Expect (TokenClass.CloseBracket);
     return ret;
 }
 public void Accept(ListExpression list)
 {
     visitSubnodes (list);
     methodBuilder.EmitInstruction (list.Location, Opcode.BuildList, list.Children.Count);
 }
		public override void Accept (ListExpression list)
		{
			list.VisitChildren (this);
			methodBuilder.EmitInstruction (list.Location, Opcode.BuildList, list.Children.Count);
		}
Exemple #4
0
 public void Accept(ListExpression list)
 {
     list.Visit (functionCompiler);
 }
		public override void Accept (ListExpression list)
		{
			list.Visit (this);
		}
 public virtual void Accept(ListExpression list)
 {
 }
 public void Accept(ListExpression list)
 {
     list.VisitChildren (this);
 }
Exemple #8
0
 public void Accept(ListExpression list)
 {
 }