summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2008-07-09 11:05:30 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2008-07-09 11:05:30 +0000
commit01a20f46ef7a6c94edf31b13f7ca8cf10fbb87b9 (patch)
treeea840f565b7d804b233e0cab2c29f4397891cb7b /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parent7b90be13587562ec02c1d4574abae8600d39bf28 (diff)
downloadscala-01a20f46ef7a6c94edf31b13f7ca8cf10fbb87b9.tar.gz
scala-01a20f46ef7a6c94edf31b13f7ca8cf10fbb87b9.tar.bz2
scala-01a20f46ef7a6c94edf31b13f7ca8cf10fbb87b9.zip
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).
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala6
1 files changed, 4 insertions, 2 deletions
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) {