Skip to content

Commit

Permalink
ExpressionSample - refactor Stmt (PrintList)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbymcr committed Apr 15, 2018
1 parent 5f36443 commit 6083c90
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions projects/ExpressionSample/GWParse/Statements/Stmt.cs
Expand Up @@ -42,17 +42,16 @@ internal static class Stmt
select new PrintStatement(Enumerable.Empty<BasicExpression>());

private static readonly Parser<IEnumerable<BasicExpression>> PrintList =
from k in Kw.Print
from head in Expr.Any.Once()
from rest in Ch.Semicolon.Then(_ => Expr.Any).Many()
select head.Concat(rest);

private static readonly Parser<BasicStatement> PrintMany =
from k in Kw.Print
from list in PrintList
select new PrintStatement(list);

private static readonly Parser<BasicStatement> PrintNMany =
from k in Kw.Print
from list in PrintList
from o in Ch.Semicolon
select new PrintStatement(list, false);
Expand Down

0 comments on commit 6083c90

Please sign in to comment.