diff options
author | michelou <michelou@epfl.ch> | 2011-09-20 17:15:33 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2011-09-20 17:15:33 +0000 |
commit | 158e6e610604c5a48177c94a1d74f16ac49730ab (patch) | |
tree | db791b6b4eda39c171c0feaf079eb44b47b4b271 /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | |
parent | 47a131ac36c1d98686d15394b60447ae620765e7 (diff) | |
download | scala-158e6e610604c5a48177c94a1d74f16ac49730ab.tar.gz scala-158e6e610604c5a48177c94a1d74f16ac49730ab.tar.bz2 scala-158e6e610604c5a48177c94a1d74f16ac49730ab.zip |
fixed svn props and scaladoc tags, did some cle...
fixed svn props and scaladoc tags, did some cleanup
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index b06ecdb859..07aebb6f32 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -118,7 +118,7 @@ trait ParsersCommon extends ScannersCommon { * </li> * </ol> */ -trait Parsers extends Scanners with MarkupParsers with ParsersCommon { +trait Parsers extends Scanners /*@XML*/ with MarkupParsers /*XML@*/ with ParsersCommon { self => val global: Global import global._ @@ -158,6 +158,7 @@ self => def incompleteInputError(msg: String): Unit = throw new MalformedInput(source.content.length - 1, msg) /** the markup parser */ +/*@XML*/ lazy val xmlp = new MarkupParser(this, true) object symbXMLBuilder extends SymbolicXMLBuilder(this, true) { // DEBUG choices @@ -167,6 +168,7 @@ self => def xmlLiteral : Tree = xmlp.xLiteral def xmlLiteralPattern : Tree = xmlp.xLiteralPattern +/*XML@*/ } class OutlineParser(source: SourceFile) extends SourceFileParser(source) { @@ -175,12 +177,16 @@ self => accept(LBRACE) var openBraces = 1 while (in.token != EOF && openBraces > 0) { + /*@XML*/ if (in.token == XMLSTART) xmlLiteral() else { + /*XML@*/ if (in.token == LBRACE) openBraces += 1 else if (in.token == RBRACE) openBraces -= 1 in.nextToken() + /*@XML*/ } + /*XML@*/ } body } @@ -624,7 +630,7 @@ self => def isExprIntroToken(token: Int): Boolean = isLiteralToken(token) || (token match { case IDENTIFIER | BACKQUOTED_IDENT | THIS | SUPER | IF | FOR | NEW | USCORE | TRY | WHILE | - DO | RETURN | THROW | LPAREN | LBRACE | XMLSTART => true + DO | RETURN | THROW | LPAREN | LBRACE /*@XML*/| XMLSTART /*XML@*/ => true case _ => false }) @@ -1383,6 +1389,7 @@ self => * Expr ::= implicit Id => Expr * }}} */ + def implicitClosure(start: Int, location: Int): Tree = { val param0 = convertToParam { atPos(in.offset) { @@ -1448,7 +1455,9 @@ self => } else simpleExpr() } + /*@XML*/ def xmlLiteral(): Tree + /*XML@*/ /** {{{ * SimpleExpr ::= new (ClassTemplate | TemplateBody) @@ -1468,8 +1477,10 @@ self => val t = if (isLiteral) atPos(in.offset)(literal(false)) else in.token match { + /*@XML*/ case XMLSTART => xmlLiteral() + /*XML@*/ case IDENTIFIER | BACKQUOTED_IDENT | THIS | SUPER => path(true, false) case USCORE => @@ -1815,8 +1826,10 @@ self => atPos(start) { literal(false) } case LPAREN => atPos(start)(makeParens(noSeq.patterns())) + /*@XML*/ case XMLSTART => xmlLiteralPattern() + /*XML@*/ case _ => syntaxErrorOrIncomplete("illegal start of simple pattern", true) errorPatternTree @@ -1858,7 +1871,9 @@ self => if (in.token == RPAREN) Nil else seqPatterns() } + /*@XML*/ def xmlLiteralPattern(): Tree + /*XML@*/ /* -------- MODIFIERS and ANNOTATIONS ------------------------------------------- */ @@ -1879,7 +1894,8 @@ self => (mods | mod) withPosition (mod, pos) } - private def tokenRange(token: TokenData) = r2p(token.offset, token.offset, token.offset + token.name.length - 1) + private def tokenRange(token: TokenData) = + r2p(token.offset, token.offset, token.offset + token.name.length - 1) /** {{{ * AccessQualifier ::= `[' (Id | this) `]' |