From 37adfa72f2658b0859a61f09cae5d400efec123e Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sun, 16 Nov 2014 14:51:12 -0800 Subject: All tests pass??? --- scalatexApi/src/main/scala/scalatex/stages/Parser.scala | 4 ++-- scalatexApi/src/main/scala/torimatomeru/ScalaSyntax.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scalatexApi/src/main/scala') diff --git a/scalatexApi/src/main/scala/scalatex/stages/Parser.scala b/scalatexApi/src/main/scala/scalatex/stages/Parser.scala index 9693544..d143463 100644 --- a/scalatexApi/src/main/scala/scalatex/stages/Parser.scala +++ b/scalatexApi/src/main/scala/scalatex/stages/Parser.scala @@ -99,7 +99,7 @@ class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends Scala (push(offsetCursor) ~ capture(ArgumentExprs2) ~> ((x, y) => Ast.Chain.Args(y, x))) | BraceBlock } - def Ws = Whitespace + def Ws = WhiteLines // clones of the version in ScalaSyntax, but without tailing whitespace or newlines def TypeArgs2 = rule { '[' ~ Ws ~ Types ~ ']' } def ArgumentExprs2 = rule { @@ -107,7 +107,7 @@ class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends Scala (optional(Exprs ~ ',' ~ Ws) ~ PostfixExpr() ~ ':' ~ Ws ~ '_' ~ Ws ~ '*' ~ Ws | optional(Exprs) ) ~ ')' } - def BlockExpr2: Rule0 = rule { '{' ~ Ws ~ (CaseClauses | Block) ~ '}' } + def BlockExpr2: Rule0 = rule { '{' ~ Ws ~ (CaseClauses | Block) ~ Ws ~ '}' } def BraceBlock: Rule1[Ast.Block] = rule{ '{' ~ BodyNoBrace ~ '}' } def BodyItem(exclusions: String): Rule1[Seq[Ast.Block.Sub]] = rule{ diff --git a/scalatexApi/src/main/scala/torimatomeru/ScalaSyntax.scala b/scalatexApi/src/main/scala/torimatomeru/ScalaSyntax.scala index be3b076..283926e 100644 --- a/scalatexApi/src/main/scala/torimatomeru/ScalaSyntax.scala +++ b/scalatexApi/src/main/scala/torimatomeru/ScalaSyntax.scala @@ -129,7 +129,7 @@ class ScalaSyntax(val input: ParserInput) extends Parser with Basic with Identif def SimpleExpr1(G: B = true) = rule{ "new" ~ (ClassTemplate(G) | TemplateBody(G)) | BlockExpr(G) | - LiteralS() ~ drop[String] | + LiteralS(G) ~ drop[String] | Path(G) | '_' | '(' ~ optional(Exprs) ~ wspStrG(")", G) @@ -144,7 +144,7 @@ class ScalaSyntax(val input: ParserInput) extends Parser with Basic with Identif def BlockExpr(G: B = true): Rule0 = rule { '{' ~ (CaseClauses | Block) ~ wspStrG("}", G) } def Block: Rule0 = rule { zeroOrMore(BlockStat ~ SemiS) ~ optional(ResultExpr()) } def BlockStat: Rule0 = rule { - &(SemiS) ~ MATCH | //shortcircuit when Semi is found + SemiS | Import(false) | zeroOrMore(Annotation) ~ (optional("implicit" | "lazy") ~ Def(false) | zeroOrMore(LocalModifier) ~ TmplDef(false)) | Expr1(false) -- cgit v1.2.3