Example #1
0
 private static void PrintMatchStatement(PrintState s, MatchStatement a)
 {
     PrintLine(s, "MatchStatement");
     Indent(s);
     PrintDescWithAny(s, "Expr", a.Expr);
     PrintDescWithList(s, "Cases", a.Cases);
     UnIndent(s);
 }
Example #2
0
        private static MatchStatement ParseMatchStatement(ParserState s)
        {
            var result = new MatchStatement {
                Cases = new List <MatchCase>()
            };

            ReadToken(s);
            result.Expr = ParseExpression(s, 0, false);
            ParseTokenWithType(s, TokenType.OpenBrace);
            while (s.Token.Type != TokenType.CloseBrace)
            {
                result.Cases.Add(ParseMatchCase(s));
            }
            ParseTokenWithType(s, TokenType.CloseBrace);
            return(result);
        }
Example #3
0
 private static void CheckMatchStatement(RangeFinderState s, MatchStatement a)
 {
     CheckAny(s, a.Expr);
     CheckList(s, a.Cases);
 }