|
Revision 2072, 2.3 kB
(checked in by dlsmith, 2 months ago)
|
Updated ASTGen with improved support for custom extensions. Related bug fixes in ASTGen exposed the fact that the Applicable node class doesn't belong in the Node hierarchy -- there are non-node instances that don't support visiting, for example -- so it was moved to nodes_util. Similarly, Fortress.ast was adjusted to be compatible with clarified semantics of ASTGen.
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
package com.sun.fortress.interpreter.evaluator.values; |
|---|
| 19 |
|
|---|
| 20 |
import java.util.List; |
|---|
| 21 |
|
|---|
| 22 |
import com.sun.fortress.interpreter.evaluator.Environment; |
|---|
| 23 |
import com.sun.fortress.interpreter.evaluator.types.FType; |
|---|
| 24 |
import com.sun.fortress.nodes_util.Applicable; |
|---|
| 25 |
import com.sun.fortress.useful.HasAt; |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
public class MethodClosureInstance extends MethodClosure implements MethodInstance { |
|---|
| 33 |
|
|---|
| 34 |
GenericMethod generator; |
|---|
| 35 |
Environment genericEnv; |
|---|
| 36 |
|
|---|
| 37 |
public MethodClosureInstance(Environment within, Environment genericEnv, Applicable fndef, FType definer, List<FType> args, GenericMethod generator) { |
|---|
| 38 |
super(within, fndef, definer, args); |
|---|
| 39 |
this.generator = generator; |
|---|
| 40 |
this.genericEnv = genericEnv; |
|---|
| 41 |
if (!genericEnv.getBlessed()) { |
|---|
| 42 |
System.out.println("Creating a MethodClosureInstance for "+fndef+args+ |
|---|
| 43 |
"with unblessed genericEnv "+genericEnv); |
|---|
| 44 |
} |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
public Environment getEvalEnv() { |
|---|
| 48 |
return genericEnv; |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
@Override |
|---|
| 55 |
protected Environment envForApplication(FObject selfValue, HasAt loc) { |
|---|
| 56 |
return selfValue.getLexicalEnv().genericLeafEnvHack(genericEnv, loc); |
|---|
| 57 |
} |
|---|
| 58 |
|
|---|
| 59 |
public GenericMethod getGenerator() { |
|---|
| 60 |
return generator; |
|---|
| 61 |
} |
|---|
| 62 |
|
|---|
| 63 |
} |
|---|