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 | |
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')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 22 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala | 17 |
2 files changed, 28 insertions, 11 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) `]' diff --git a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala index aa862653d6..b8fa55447a 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala @@ -12,12 +12,13 @@ import xml.XML.{ xmlns } import symtab.Flags.MUTABLE import scala.tools.util.StringOps.splitWhere -/** This class builds instance of <code>Tree</code> that represent XML. +/** This class builds instance of `Tree` that represent XML. * - * Note from martin: This needs to have its position info reworked. I don't understand exactly - * what's done here. To make validation pass, I set many positions to be transparent. Not sure this - * is a good idea for navigating XML trees in the IDE< but it's the best I can do right now. If someone - * who understands this part better wants to give it a shot, please do! + * Note from martin: This needs to have its position info reworked. I don't + * understand exactly what's done here. To make validation pass, I set many + * positions to be transparent. Not sure this is a good idea for navigating + * XML trees in the IDE but it's the best I can do right now. If someone + * who understands this part better wants to give it a shot, please do! * * @author Burak Emir * @version 1.0 @@ -26,9 +27,9 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) { val global: Global import global._ - var isPattern: Boolean = _ + private[parser] var isPattern: Boolean = _ - trait XMLTypeNames extends TypeNames { + private trait XMLTypeNames extends TypeNames { val _Comment: NameType = "Comment" val _Elem: NameType = "Elem" val _EntityRef: NameType = "EntityRef" @@ -43,7 +44,7 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) { val _UnprefixedAttribute: NameType = "UnprefixedAttribute" } - trait XMLTermNames extends TermNames { + private trait XMLTermNames extends TermNames { val _Null: NameType = "Null" val __Elem: NameType = "Elem" val __Text: NameType = "Text" |