equal
deleted
inserted
replaced
20 val body = not(rep(whitespace) ~ (command | eof)) ~> not_eof |
20 val body = not(rep(whitespace) ~ (command | eof)) ~> not_eof |
21 command ~ rep(body) ^^ { case x ~ ys => x :: ys } | rep1(whitespace) | rep1(body) |
21 command ~ rep(body) ^^ { case x ~ ys => x :: ys } | rep1(whitespace) | rep1(body) |
22 } |
22 } |
23 } |
23 } |
24 |
24 |
25 type Span = List[Outer_Lex.Token] |
25 type Span = List[Token] |
26 |
26 |
27 def parse_spans(toks: List[Outer_Lex.Token]): List[Span] = |
27 def parse_spans(toks: List[Token]): List[Span] = |
28 { |
28 { |
29 import parser._ |
29 import parser._ |
30 |
30 |
31 parse(rep(command_span), Outer_Lex.reader(toks)) match { |
31 parse(rep(command_span), Token.reader(toks)) match { |
32 case Success(spans, rest) if rest.atEnd => spans |
32 case Success(spans, rest) if rest.atEnd => spans |
33 case bad => error(bad.toString) |
33 case bad => error(bad.toString) |
34 } |
34 } |
35 } |
35 } |
36 } |
36 } |