summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-08-08 16:01:46 +0000
committerpaltherr <paltherr@epfl.ch>2003-08-08 16:01:46 +0000
commit5a3dead77fc2af616d1949e885cdfd1c8f4a4281 (patch)
treee3b61087eed74226be09ff3fcab953a7bfec92f1 /sources
parentc513a75367632aa79463218ed63c22dfa957b4de (diff)
downloadscala-5a3dead77fc2af616d1949e885cdfd1c8f4a4281.tar.gz
scala-5a3dead77fc2af616d1949e885cdfd1c8f4a4281.tar.bz2
scala-5a3dead77fc2af616d1949e885cdfd1c8f4a4281.zip
- Replaced NOPOS by FIRSTPOS or other non zero ...
- Replaced NOPOS by FIRSTPOS or other non zero position
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/Global.java41
-rw-r--r--sources/scalac/symtab/Type.java2
-rw-r--r--sources/scalac/transformer/matching/Autom2Scala.java24
-rw-r--r--sources/scalac/transformer/matching/CodeFactory.java40
-rw-r--r--sources/scalac/transformer/matching/LeftTracerInScala.java16
-rw-r--r--sources/scalac/transformer/matching/PatternMatcher.java2
-rw-r--r--sources/scalac/transformer/matching/PatternNode.java2
-rw-r--r--sources/scalac/transformer/matching/PatternNodeCreator.java4
-rw-r--r--sources/scalac/transformer/matching/RightTracerInScala.java8
-rw-r--r--sources/scalac/transformer/matching/SequenceMatcher.java10
-rw-r--r--sources/scalac/transformer/matching/TracerInScala.java2
-rw-r--r--sources/scalac/transformer/matching/WordAutomInScala.java6
12 files changed, 80 insertions, 77 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java
index 44636ff982..53c5d05061 100644
--- a/sources/scalac/Global.java
+++ b/sources/scalac/Global.java
@@ -8,6 +8,7 @@
package scalac;
+import ch.epfl.lamp.util.Position;
import ch.epfl.lamp.util.SourceFile;
import java.io.*;
@@ -405,11 +406,12 @@ public class Global {
private void fix1(Unit unit) {
unit.body = new Tree[] {
- make.ModuleDef(0, 0, Name.fromString(CONSOLE_S+module), Tree.Empty,
- make.Template(0, new Tree[]{
- make.Apply(0,
- make.Select(0,
- make.Ident(0, Names.scala),
+ make.ModuleDef(Position.FIRSTPOS,
+ 0, Name.fromString(CONSOLE_S+module), Tree.Empty,
+ make.Template(Position.FIRSTPOS, new Tree[]{
+ make.Apply(Position.FIRSTPOS,
+ make.Select(Position.FIRSTPOS,
+ make.Ident(Position.FIRSTPOS, Names.scala),
Names.Object.toTypeName()),
new Tree[0])},
unit.body))};
@@ -435,14 +437,15 @@ public class Global {
Tree last = impl.body[impl.body.length - 1];
if (last.isTerm()) {
impl.body[impl.body.length - 1] =
- treeGen.Apply(
- treeGen.Select(
- treeGen.mkRef(0, INTERPRETER()),
+ treeGen.Apply(last.pos,
+ treeGen.Select(last.pos,
+ treeGen.mkRef(last.pos, INTERPRETER()),
SET_EVALUATION_RESULT()),
new Tree[] {
last,
- make.Literal(0, show(last.type())).setType(
- definitions.JAVA_STRING_TYPE)});
+ make.Literal(last.pos,
+ show(last.type())).setType(
+ definitions.JAVA_STRING_TYPE)});
}
TreeList body = new TreeList();
for (int j = 0; j < impl.body.length; j++)
@@ -466,25 +469,25 @@ public class Global {
case TypeDef(_, _, _, _):
if (!mustShow(tree.symbol())) return;
body.append(
- treeGen.Apply(
- treeGen.Select(
- treeGen.mkRef(0, INTERPRETER()),
+ treeGen.Apply(tree.pos,
+ treeGen.Select(tree.pos,
+ treeGen.mkRef(tree.pos, INTERPRETER()),
SHOW_DEFINITION()),
new Tree[] {
- make.Literal(0, show(tree.symbol())).setType(
+ make.Literal(tree.pos, show(tree.symbol())).setType(
definitions.JAVA_STRING_TYPE)}));
return;
case ValDef(_, _, _, _):
if (!mustShow(tree.symbol())) return;
body.append(
- treeGen.Apply(
- treeGen.Select(
- treeGen.mkRef(0, INTERPRETER()),
+ treeGen.Apply(tree.pos,
+ treeGen.Select(tree.pos,
+ treeGen.mkRef(tree.pos, INTERPRETER()),
SHOW_VALUE_DEFINITION()),
new Tree[] {
- make.Literal(0, show(tree.symbol())).setType(
+ make.Literal(tree.pos, show(tree.symbol())).setType(
definitions.JAVA_STRING_TYPE),
- treeGen.Ident(tree.symbol())}));
+ treeGen.Ident(tree.pos, tree.symbol())}));
return;
default:
return;
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index 10578d02de..b23b9448f9 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -157,7 +157,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
public static CompoundType compoundType(Type[] parts, Scope members) {
ExtCompoundType res = new ExtCompoundType(parts, members);
res.tsym = new ClassSymbol(
- Position.NOPOS, Names.COMPOUND_NAME.toTypeName(), Symbol.NONE,
+ Position.FIRSTPOS, Names.COMPOUND_NAME.toTypeName(), Symbol.NONE,
SYNTHETIC | ABSTRACTCLASS);
res.tsym.setInfo(res);
res.tsym.primaryConstructor().setInfo(
diff --git a/sources/scalac/transformer/matching/Autom2Scala.java b/sources/scalac/transformer/matching/Autom2Scala.java
index 19785e840e..e90be90509 100644
--- a/sources/scalac/transformer/matching/Autom2Scala.java
+++ b/sources/scalac/transformer/matching/Autom2Scala.java
@@ -147,7 +147,7 @@ public class Autom2Scala {
this.defs = cf.defs;
this.gen = cf.gen;
this.owner = owner;
- this.pos = 0;
+ this.pos = Position.FIRSTPOS;
this.cf = cf;
this.am = new AlgebraicMatcher( cf.unit, cf.infer );
this.mdefs = new Vector();
@@ -161,11 +161,11 @@ public class Autom2Scala {
Symbol hasnSym;
Tree loadCurrentElem( Tree body ) {
- return cf.Block( Position.NOPOS, new Tree[] {
- cf.gen.ValDef( 0,
+ return cf.Block( Position.FIRSTPOS, new Tree[] {
+ cf.gen.ValDef( Position.FIRSTPOS,
this.hasnSym,
cf._hasNext( _iter() ) ),
- cf.gen.ValDef( 0,
+ cf.gen.ValDef( Position.FIRSTPOS,
this.curSym,
cf.If( _ref( hasnSym ),//cf._hasNext( _iter() ),
cf._next( _iter() ),
@@ -175,7 +175,7 @@ public class Autom2Scala {
}
Tree currentElem() {
- return gen.Ident(0, curSym);
+ return gen.Ident(Position.FIRSTPOS, curSym);
}
Tree currentMatches( Label label ) {
@@ -205,7 +205,7 @@ public class Autom2Scala {
Tree code_assignInt( Symbol sym, Integer val ){
return make.Assign(pos,
code_ref( sym ),
- gen.mkIntLit(Position.NOPOS, val ))
+ gen.mkIntLit(Position.FIRSTPOS, val ))
.setType( defs.UNIT_TYPE );
}
*/
@@ -279,7 +279,7 @@ public class Autom2Scala {
// returns a Tree whose type is boolean.
Tree handleBody( Object help ) {
// don't care about free vars
- return gen.mkBooleanLit( Position.NOPOS, true );
+ return gen.mkBooleanLit( Position.FIRSTPOS, true );
}
// calling the /*AlgebraicMatcher*/PatternMatcher here
@@ -312,16 +312,16 @@ public class Autom2Scala {
}
Tree code_fail() {
- return gen.mkIntLit(Position.NOPOS, FAIL );
+ return gen.mkIntLit(Position.FIRSTPOS, FAIL );
}
/** code for the return value of the automaton translation
*/
Tree run_finished( int state ) {
if( dfa.isFinal( state )) {
- return gen.mkIntLit(Position.NOPOS, ((Integer) dfa.finals.get( new Integer( state ) )).intValue() );
+ return gen.mkIntLit(Position.FIRSTPOS, ((Integer) dfa.finals.get( new Integer( state ) )).intValue() );
}
- return gen.mkIntLit(Position.NOPOS, FAIL );
+ return gen.mkIntLit(Position.FIRSTPOS, FAIL );
}
/*
@@ -338,7 +338,7 @@ public class Autom2Scala {
Tree wrapStateBody0( Tree stateBody,
Tree elseBody,
int i ) {
- return cf.If( cf.Equals( _state(), gen.mkIntLit(Position.NOPOS, i )),
+ return cf.If( cf.Equals( _state(), gen.mkIntLit(Position.FIRSTPOS, i )),
stateBody ,
elseBody );
}
@@ -371,7 +371,7 @@ public class Autom2Scala {
if( dfa.isSink( i ) ) // state won't change anymore (binding?)
- return cf.If( cf.Equals( _state(), gen.mkIntLit(Position.NOPOS, i )),
+ return cf.If( cf.Equals( _state(), gen.mkIntLit(Position.FIRSTPOS, i )),
runFinished,
elseBody );
diff --git a/sources/scalac/transformer/matching/CodeFactory.java b/sources/scalac/transformer/matching/CodeFactory.java
index 662e3c8c31..425fd4c9ac 100644
--- a/sources/scalac/transformer/matching/CodeFactory.java
+++ b/sources/scalac/transformer/matching/CodeFactory.java
@@ -20,7 +20,7 @@ import Tree.*;
class CodeFactory extends PatternTool {
- private int pos = Position.NOPOS ;
+ private int pos = Position.FIRSTPOS ;
static final Name HEAD_N = Name.fromString("head");
@@ -158,7 +158,7 @@ class CodeFactory extends PatternTool {
/** returns `<seqObj.elements>' */
Tree newIterator( Tree seqObj, Type elemType ) {
Symbol newIterSym = newIterSym();
- Tree t1 = gen.Select( Position.NOPOS, seqObj, newIterSym)
+ Tree t1 = gen.Select( Position.FIRSTPOS, seqObj, newIterSym)
.setType( Type.MethodType(new Symbol[] {},_seqIterType( elemType )));
Tree theIterator = gen.Apply(seqObj.pos,
@@ -181,29 +181,29 @@ class CodeFactory extends PatternTool {
*/
Tree ignoreValue( Type asType ) {
if( asType.isSameAs(defs.BYTE_TYPE ))
- return make.Literal(Position.NOPOS, new Integer( 0 ))
+ return make.Literal(Position.FIRSTPOS, new Integer( 0 ))
.setType( defs.INT_TYPE );
else if( asType.isSameAs( defs.CHAR_TYPE ))
- return make.Literal(Position.NOPOS, new Character( 'a' ))
+ return make.Literal(Position.FIRSTPOS, new Character( 'a' ))
.setType( defs.CHAR_TYPE );
else if( asType.isSameAs(defs.SHORT_TYPE ))
- return make.Literal(Position.NOPOS, new Integer/*Short?*/( 0 ))
+ return make.Literal(Position.FIRSTPOS, new Integer/*Short?*/( 0 ))
.setType( defs.SHORT_TYPE );
else if( asType.isSameAs(defs.INT_TYPE ))
return Int( 0 );
else if( asType.isSameAs(defs.LONG_TYPE ))
- return make.Literal(Position.NOPOS, new Long( 0 ))
+ return make.Literal(Position.FIRSTPOS, new Long( 0 ))
.setType( defs.LONG_TYPE );
else if( asType.isSameAs(defs.FLOAT_TYPE ))
- return make.Literal(Position.NOPOS, new Float( 0 ))
+ return make.Literal(Position.FIRSTPOS, new Float( 0 ))
.setType( defs.FLOAT_TYPE );
else if( asType.isSameAs(defs.DOUBLE_TYPE ))
- return make.Literal(Position.NOPOS, new Double( 0 ))
+ return make.Literal(Position.FIRSTPOS, new Double( 0 ))
.setType( defs.DOUBLE_TYPE );
else if( asType.isSameAs(defs.BOOLEAN_TYPE ))
- return gen.mkBooleanLit(Position.NOPOS, false);
+ return gen.mkBooleanLit(Position.FIRSTPOS, false);
else if( asType.isSameAs(defs.STRING_TYPE ))
- return make.Literal(Position.NOPOS, "")
+ return make.Literal(Position.FIRSTPOS, "")
.setType( defs.STRING_TYPE );
/** FIX ME FOR THE NEW VERSION*/
else
@@ -222,7 +222,7 @@ class CodeFactory extends PatternTool {
// the caller needs to set the type !
Tree _applyNone( Tree arg ) {
- return make.Apply(Position.NOPOS, arg, Tree.EMPTY_ARRAY );
+ return make.Apply(Position.FIRSTPOS, arg, Tree.EMPTY_ARRAY );
}
/** code `new SeqTraceNil[ elemType ]()'
@@ -230,7 +230,7 @@ class CodeFactory extends PatternTool {
Tree _seqTraceNil( Type elemType ) {
assert elemType != null : "elemType = null??";
- return gen.New( Position.NOPOS, defs.SCALA_TYPE, seqTraceNilSym(),
+ return gen.New( Position.FIRSTPOS, defs.SCALA_TYPE, seqTraceNilSym(),
new Type[] { elemType },
new Tree[] {});
}
@@ -243,7 +243,7 @@ class CodeFactory extends PatternTool {
}
Tree Int( Integer valI ) {
- return make.Literal( Position.NOPOS, valI )
+ return make.Literal( Position.FIRSTPOS, valI )
.setType( defs.INT_TYPE );
}
@@ -254,7 +254,7 @@ class CodeFactory extends PatternTool {
assert head != null : "head null";
assert tail != null : "tail null";
assert state != null : "state null";
- return gen.New( Position.NOPOS, defs.SCALA_TYPE, seqTraceConsSym(),
+ return gen.New( Position.FIRSTPOS, defs.SCALA_TYPE, seqTraceConsSym(),
new Type[] { head.type() },
new Tree[] { Int( state ), head, tail });
}
@@ -279,28 +279,28 @@ class CodeFactory extends PatternTool {
Tree newSeqNil( Type tpe ) {
/*
assert tpe != null :"tpe = null !?";
- return gen.New( Position.NOPOS, defs.SCALA_TYPE, seqNilSym(),
+ return gen.New( Position.FIRSTPOS, defs.SCALA_TYPE, seqNilSym(),
new Type[] { tpe },
new Tree[] {});
*/
- return gen.Select(gen.Ident(0, defs.SCALA), Names.Nil/*seqNilSym()*/);
+ return gen.Select(gen.Ident(Position.FIRSTPOS, defs.SCALA), Names.Nil/*seqNilSym()*/);
}
// EXPERIMENTAL
Tree newRef( Tree init ) {
//System.out.println( "hello:"+refSym().type() );
- return gen.New( 0, defs.SCALA_TYPE, refSym(),
+ return gen.New( Position.FIRSTPOS, defs.SCALA_TYPE, refSym(),
new Type[] { init.type() },
new Tree[] { init } );
/*
- return gen.Apply( gen.TypeApply(0, gen.Select(gen.Ident(0, defs.SCALA), Names.Ref),
- new Tree[] { gen.mkType(0, init.type() ) } ),
+ return gen.Apply( gen.TypeApply(Position.FIRSTPOS, gen.Select(gen.Ident(Position.FIRSTPOS, defs.SCALA), Names.Ref),
+ new Tree[] { gen.mkType(Position.FIRSTPOS, init.type() ) } ),
new Tree[] { init } );
*/
}
Tree newSeqCons( Tree head, Tree tail ) {
- return gen.New( Position.NOPOS, defs.SCALA_TYPE, seqConsSym(),
+ return gen.New( Position.FIRSTPOS, defs.SCALA_TYPE, seqConsSym(),
new Type[] { head.type() },
new Tree[] { head, tail });
}
diff --git a/sources/scalac/transformer/matching/LeftTracerInScala.java b/sources/scalac/transformer/matching/LeftTracerInScala.java
index 85e1e002eb..336858d453 100644
--- a/sources/scalac/transformer/matching/LeftTracerInScala.java
+++ b/sources/scalac/transformer/matching/LeftTracerInScala.java
@@ -96,14 +96,14 @@ public class LeftTracerInScala extends TracerInScala {
Symbol vsym = (Symbol) it.next();
Symbol hv = (Symbol) helpMap.get( vsym );
hv.type( cf.SeqListType( elementType ) ) ;
- Tree refv = gen.Ident(Position.NOPOS, vsym);
- Tree refhv = gen.Ident(Position.NOPOS, hv);
+ Tree refv = gen.Ident(Position.FIRSTPOS, vsym);
+ Tree refhv = gen.Ident(Position.FIRSTPOS, hv);
res[ j++ ] = gen.Assign( refhv, refv );
}
res[ j ] = super.handleBody( freeVars ); // just `true'
- return cf.Block(Position.NOPOS, res, res[j].type() );
+ return cf.Block(Position.FIRSTPOS, res, res[j].type() );
}
*/
protected void initializeSyms() {
@@ -243,7 +243,7 @@ public class LeftTracerInScala extends TracerInScala {
cf.newIterator( selector, selector.type() ),
cf.Int( 0 ) });
- run = gen.ValDef( Position.NOPOS, resultSym, run );
+ run = gen.ValDef( Position.FIRSTPOS, resultSym, run );
v.add( run );
@@ -285,11 +285,11 @@ public class LeftTracerInScala extends TracerInScala {
//System.out.println("ouch! v Left");
Symbol hv = makeHelpVarSEQ( pat );
nestedMap.put( pat, hv );
- Tree stm = gen.Assign( gen.Ident(0, hv), currentElem() );
+ Tree stm = gen.Assign( gen.Ident(Position.FIRSTPOS, hv), currentElem() );
m.stms = new Tree[2];
m.stms[0] = stm;
- m.stms[1] = gen.mkBooleanLit(Position.NOPOS, true);
- return cf.Block( 0, m.stms, m.stms[1].type() );
+ m.stms[1] = gen.mkBooleanLit(Position.FIRSTPOS, true);
+ return cf.Block( Position.FIRSTPOS, m.stms, m.stms[1].type() );
}
}
@@ -310,7 +310,7 @@ public class LeftTracerInScala extends TracerInScala {
//DON'T .setSymbol( Symbol.NONE ) !
.setType(pat.type()),
Tree.Empty,
- gen.mkBooleanLit(Position.NOPOS, false)) },
+ gen.mkBooleanLit(Position.FIRSTPOS, false)) },
false
);
Tree res = am.toTree().setType( defs.BOOLEAN_TYPE );
diff --git a/sources/scalac/transformer/matching/PatternMatcher.java b/sources/scalac/transformer/matching/PatternMatcher.java
index 2420e361b3..6e0cc8f069 100644
--- a/sources/scalac/transformer/matching/PatternMatcher.java
+++ b/sources/scalac/transformer/matching/PatternMatcher.java
@@ -483,7 +483,7 @@ public class PatternMatcher extends PatternTool {
// check if we have to add a new header
if (curHeader == null) {
assert index >= 0 : casted;
- if (casted.pos == Position.NOPOS) {
+ if (casted.pos == Position.FIRSTPOS) {
Symbol atSym = casted.type().lookup(APPLY_N);
//System.out.println("casted type = " + typeOf(casted));
Type seqType = casted.type().baseType(defs.SEQ_CLASS).typeArgs()[0];
diff --git a/sources/scalac/transformer/matching/PatternNode.java b/sources/scalac/transformer/matching/PatternNode.java
index d089c6f432..a1f6f38863 100644
--- a/sources/scalac/transformer/matching/PatternNode.java
+++ b/sources/scalac/transformer/matching/PatternNode.java
@@ -18,7 +18,7 @@ import scalac.typechecker.*;
*/
public class PatternNode {
- public int pos = Position.NOPOS;
+ public int pos = Position.FIRSTPOS;
public Type type;
public PatternNode or;
public PatternNode and;
diff --git a/sources/scalac/transformer/matching/PatternNodeCreator.java b/sources/scalac/transformer/matching/PatternNodeCreator.java
index cecb9dc7bf..6e62f54751 100644
--- a/sources/scalac/transformer/matching/PatternNodeCreator.java
+++ b/sources/scalac/transformer/matching/PatternNodeCreator.java
@@ -19,14 +19,14 @@ import java.util.Vector ;
public class PatternNodeCreator extends PatternTool {
public SequencePat SequencePat(int pos, Type type, int len) {
- Symbol sym = newVar(Position.NOPOS, type);
+ Symbol sym = newVar(Position.FIRSTPOS, type);
SequencePat node = new SequencePat(sym, len);
node.pos = pos;
node.type = type;
return node;
}
public SeqContainerPat SeqContainerPat(int pos, Type type, Tree seqpat) {
- Symbol sym = newVar(Position.NOPOS, type);
+ Symbol sym = newVar(Position.FIRSTPOS, type);
SeqContainerPat node = new SeqContainerPat(sym, seqpat);
node.pos = pos;
node.type = type;
diff --git a/sources/scalac/transformer/matching/RightTracerInScala.java b/sources/scalac/transformer/matching/RightTracerInScala.java
index bb65ae68f6..e103958b11 100644
--- a/sources/scalac/transformer/matching/RightTracerInScala.java
+++ b/sources/scalac/transformer/matching/RightTracerInScala.java
@@ -291,14 +291,14 @@ public class RightTracerInScala extends TracerInScala {
Symbol vsym = (Symbol) it.next();
Symbol hv = (Symbol) helpMap3.get( vsym );
hv.setType( cf.SeqListType( elementType ) ) ;
- Tree refv = gen.Ident(Position.NOPOS, vsym);
- Tree refhv = gen.Ident(Position.NOPOS, hv);
+ Tree refv = gen.Ident(Position.FIRSTPOS, vsym);
+ Tree refhv = gen.Ident(Position.FIRSTPOS, hv);
res[ j++ ] = gen.Assign( refhv, refv );
}
res[ j ] = super.handleBody( freeVars ); // just `true'
- return cf.Block(Position.NOPOS, res, res[j].type() );
+ return cf.Block(Position.FIRSTPOS, res, res[j].type() );
}
// calling the AlgebraicMatcher here
@@ -462,7 +462,7 @@ public class RightTracerInScala extends TracerInScala {
* todo: move tree generation of Unit somewhere else
*/
Tree run_finished( int state ) {
- return gen.Block(0, Tree.EMPTY_ARRAY).setType( defs.UNIT_TYPE );
+ return gen.Block(Position.FIRSTPOS, Tree.EMPTY_ARRAY).setType( defs.UNIT_TYPE );
}
Tree current() {
diff --git a/sources/scalac/transformer/matching/SequenceMatcher.java b/sources/scalac/transformer/matching/SequenceMatcher.java
index ec819c2a79..02cf68ddf6 100644
--- a/sources/scalac/transformer/matching/SequenceMatcher.java
+++ b/sources/scalac/transformer/matching/SequenceMatcher.java
@@ -57,7 +57,7 @@ public class SequenceMatcher extends PatternTool {
cf );
Tree stmsLeftNest[] = ltisNest.getTrace();
- Tree selNest = gen.Ident( 0, ltisNest.resultSym );
+ Tree selNest = gen.Ident( Position.FIRSTPOS, ltisNest.resultSym );
DetWordAutom dRightNest =
new DetWordAutom( rightNest, leftNest, dLeftNest);
@@ -66,7 +66,7 @@ public class SequenceMatcher extends PatternTool {
new RightTracerInScala( dRightNest, leftNest, mNest,
cf, pat, cf.getElemType(pat.type()));
- Tree stmsRightNest[] = rtisNest.getStms( gen.Ident( 0, v ) );
+ Tree stmsRightNest[] = rtisNest.getStms( gen.Ident( Position.FIRSTPOS, v ) );
stmsNest[ i ] = new Tree[ stmsLeftNest.length
+ stmsRightNest.length ];
@@ -102,7 +102,7 @@ public class SequenceMatcher extends PatternTool {
it.hasNext(); ){
Symbol v = (Symbol) it.next();
Tree nestPat = (Tree) spn.nestedVarToPats.get( v );
- Matcher mNest = new Matcher( _m.owner, gen.Ident(0, v), null );
+ Matcher mNest = new Matcher( _m.owner, gen.Ident(Position.FIRSTPOS, v), null );
Matcher saveM = _m; _m = mNest;
@@ -129,7 +129,7 @@ public class SequenceMatcher extends PatternTool {
Tree stms[] = ltis.getTrace();
- Tree sel = gen.Ident( 0, ltis.resultSym );
+ Tree sel = gen.Ident( Position.FIRSTPOS, ltis.resultSym );
// <- - - right
@@ -244,7 +244,7 @@ public class SequenceMatcher extends PatternTool {
scalaAut.translate();
if( defaultCase == null )
- defaultCase = cf.ThrowMatchError( Position.NOPOS, _m.resultType );
+ defaultCase = cf.ThrowMatchError( Position.FIRSTPOS, _m.resultType );
Tree newbody[] = doBinding ? addBindersToBodies( body ): body;
diff --git a/sources/scalac/transformer/matching/TracerInScala.java b/sources/scalac/transformer/matching/TracerInScala.java
index 069964fb5b..c8a64ec788 100644
--- a/sources/scalac/transformer/matching/TracerInScala.java
+++ b/sources/scalac/transformer/matching/TracerInScala.java
@@ -34,7 +34,7 @@ public class TracerInScala extends Autom2Scala {
Tree refHelpVar( Symbol realVar ) {
Symbol hv = (Symbol)helpMap.get( realVar );
assert hv != null : realVar;
- return gen.Ident(Position.NOPOS, hv);
+ return gen.Ident(Position.FIRSTPOS, hv);
}
Tree assignToHelpVar( Symbol realVar, Tree rhs ) {
diff --git a/sources/scalac/transformer/matching/WordAutomInScala.java b/sources/scalac/transformer/matching/WordAutomInScala.java
index f27b6cb286..04ebf52114 100644
--- a/sources/scalac/transformer/matching/WordAutomInScala.java
+++ b/sources/scalac/transformer/matching/WordAutomInScala.java
@@ -33,7 +33,7 @@ public class WordAutomInScala extends Autom2Scala {
Tree run = callFun( new Tree[] {
cf.newIterator(selector),
- gen.mkIntLit(Position.NOPOS, 0) } );
+ gen.mkIntLit(Position.FIRSTPOS, 0) } );
/* return code `var <swres>: scala.Int = <init>' */
@@ -45,7 +45,7 @@ public class WordAutomInScala extends Autom2Scala {
Tree cond[] = new Tree[body.length];
//Tree bbody[] = new Tree[body.length];
for (int i = body.length - 1; i >= 0; i--)
- cond[i] = cf.Equals(_swres(), gen.mkIntLit(Position.NOPOS, i));
+ cond[i] = cf.Equals(_swres(), gen.mkIntLit(Position.FIRSTPOS, i));
result = cf.Switch( selector, cond, body, failTree );
@@ -82,7 +82,7 @@ public class WordAutomInScala extends Autom2Scala {
return code_fail();
return callFun(new Tree[] { _iter(),
- gen.mkIntLit(Position.NOPOS, target.intValue())} );
+ gen.mkIntLit(Position.FIRSTPOS, target.intValue())} );
}
/** ...