From 01a20f46ef7a6c94edf31b13f7ca8cf10fbb87b9 Mon Sep 17 00:00:00 2001 From: Sean McDirmid Date: Wed, 9 Jul 2008 11:05:30 +0000 Subject: Adding some comments to document what's going o... Adding some comments to document what's going on (why we have to thread through some booleans and call another method with an identical body). --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala') diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index d3b1b79094..0c734d23bf 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1925,7 +1925,7 @@ trait Parsers extends NewScanners with MarkupParsers { val annots = annotations(true) defOrDcl(modifiers() withAnnotations annots) } - + /** not hooked by the IDE, will not undergo stubbing. Used for early initialization blocks. */ def preNonLocalDefOrDcl : List[Tree] = { val annots = annotations(true) defOrDcl(modifiers() withAnnotations annots) @@ -2290,6 +2290,7 @@ trait Parsers extends NewScanners with MarkupParsers { ////////// TEMPLATES //////////////////////////////////////////////////////////// /** TemplateBody ::= [nl] `{' TemplateStatSeq `}' + * @param isPre specifies whether in early initializer (true) or not (false) */ def templateBody(isPre : Boolean) = { accept(LBRACE) @@ -2373,6 +2374,7 @@ trait Parsers extends NewScanners with MarkupParsers { * | Expr1 * | super ArgumentExprs {ArgumentExprs} * | + * @param isPre specifies whether in early initializer (true) or not (false) */ def templateStatSeq(isPre : Boolean) = checkNoEscapingPlaceholders { var self: ValDef = emptyValDef @@ -2402,7 +2404,7 @@ trait Parsers extends NewScanners with MarkupParsers { } else if (isExprIntro) { stats += statement(InTemplate) } else if (isDefIntro || isModifier || inToken == LBRACKET /*todo: remove */ || inToken == AT) { - if (isPre) + if (isPre) // @S: avoid caching by calling a different method that does the same thing (except in the IDE) stats ++= joinComment(preNonLocalDefOrDcl) else stats ++= joinComment(nonLocalDefOrDcl) } else if (!isStatSep) { -- cgit v1.2.3