diff options
Diffstat (limited to 'scalatexApi/src/main/scala/scalatex/stages/Parser.scala')
-rw-r--r-- | scalatexApi/src/main/scala/scalatex/stages/Parser.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scalatexApi/src/main/scala/scalatex/stages/Parser.scala b/scalatexApi/src/main/scala/scalatex/stages/Parser.scala index 403cb72..0b87d97 100644 --- a/scalatexApi/src/main/scala/scalatex/stages/Parser.scala +++ b/scalatexApi/src/main/scala/scalatex/stages/Parser.scala @@ -2,7 +2,7 @@ package scalatex package stages import acyclic.file import org.parboiled2._ -import scalaparser.ScalaSyntax +import scalaParser.ScalaSyntax /** * Parses the input text into a roughly-structured AST. This AST @@ -15,7 +15,7 @@ object Parser extends ((String, Int) => Ast.Block){ new Parser(input, offset).Body.run().get } } -class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends ScalaSyntax(input) { +class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends scalaParser.ScalaSyntax(input) { def offsetCursor = offset + cursor val txt = input.sliceString(0, input.length) val indentTable = txt.split('\n').map{ s => @@ -41,7 +41,7 @@ class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends Scala "@" ~ capture(Identifiers.Id | BlockExpr2 | ('(' ~ optional(Exprs) ~ ')')) } def Header = rule { - "@" ~ capture(Def(false) | Import(false)) + "@" ~ capture(Def | Import) } def HeaderBlock: Rule1[Ast.Header] = rule{ @@ -65,7 +65,7 @@ class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends Scala test(cursorNextIndent() > indent) ~ runSubParser(new Parser(_, cursorNextIndent(), cursor).Body) } - def IfHead = rule{ "@" ~ capture("if" ~ "(" ~ Expr() ~ ")") } + def IfHead = rule{ "@" ~ capture("if" ~ "(" ~ Expr ~ ")") } def IfElse1 = rule{ push(offsetCursor) ~ IfHead ~ BraceBlock ~ optional("else" ~ (BraceBlock | IndentBlock)) } @@ -104,7 +104,7 @@ class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends Scala def TypeArgs2 = rule { '[' ~ Ws ~ Types ~ ']' } def ArgumentExprs2 = rule { '(' ~ Ws ~ - (optional(Exprs ~ ',' ~ Ws) ~ PostfixExpr() ~ ':' ~ Ws ~ '_' ~ Ws ~ '*' ~ Ws | optional(Exprs) ) ~ + (optional(Exprs ~ ',' ~ Ws) ~ PostfixExpr ~ ':' ~ Ws ~ '_' ~ Ws ~ '*' ~ Ws | optional(Exprs) ) ~ ')' } def BlockExpr2: Rule0 = rule { '{' ~ Ws ~ (CaseClauses | Block) ~ Ws ~ '}' } |