Changeset 3200
- Timestamp:
- 12/11/08 20:43:23 (12 months ago)
- Location:
- trunk/ProjectFortress
- Files:
-
- 17 modified
-
astgen/Fortress.ast (modified) (2 diffs)
-
src/com/sun/fortress/compiler/typechecker/TypeChecker.java (modified) (17 diffs)
-
src/com/sun/fortress/interpreter/evaluator/Evaluator.java (modified) (2 diffs)
-
src/com/sun/fortress/interpreter/evaluator/_WrappedFValue.java (modified) (1 diff)
-
src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java (modified) (5 diffs)
-
src/com/sun/fortress/nodes_util/ExprFactory.java (modified) (15 diffs)
-
src/com/sun/fortress/parser/DelimitedExpr.rats (modified) (3 diffs)
-
src/com/sun/fortress/parser/Expression.rats (modified) (3 diffs)
-
src/com/sun/fortress/parser/Literal.rats (modified) (2 diffs)
-
src/com/sun/fortress/parser/LocalDecl.rats (modified) (2 diffs)
-
src/com/sun/fortress/parser/NoNewlineExpr.rats (modified) (2 diffs)
-
src/com/sun/fortress/parser/preparser/PreCompilation.rats (modified) (2 diffs)
-
src/com/sun/fortress/parser_util/precedence_resolver/ASTUtil.java (modified) (1 diff)
-
src/com/sun/fortress/syntax_abstractions/phases/ComposingSyntaxDefTranslator.java (modified) (1 diff)
-
src/com/sun/fortress/syntax_abstractions/phases/EllipsesJUTest.java (modified) (9 diffs)
-
src/com/sun/fortress/syntax_abstractions/phases/Transform.java (modified) (1 diff)
-
src/com/sun/fortress/tests/unit_tests/ConstructorsJUTest.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ProjectFortress/astgen/Fortress.ast
r3199 r3200 443 443 * expression 444 444 */ 445 root abstract Expr(ignoreForEquals boolean parenthesized = false,446 ignoreForEquals Option<Type> exprType = Option.<Type>none());445 root abstract Expr(ignoreForEquals boolean parenthesized, 446 ignoreForEquals Option<Type> exprType); 447 447 448 448 /** … … 888 888 * e.g.) x y 889 889 */ 890 _RewriteFnApp(Expr function, Expr argument) implements InAfterTypeChecking; 890 _RewriteFnApp(Expr function, Expr argument) 891 implements InAfterTypeChecking; 891 892 /** 892 893 * expression using operators -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java
r3199 r3200 928 928 } 929 929 930 _RewriteFnApp new_node = new_RewriteFnApp(that.getSpan(),930 _RewriteFnApp new_node = ExprFactory.make_RewriteFnApp(that.getSpan(), 931 931 that.isParenthesized(), 932 932 result_type, … … 1633 1633 errorMsg("A 'spawn' expression must not occur inside an 'atomic' expression.")); 1634 1634 1635 AtomicExpr new_node = newAtomicExpr(that.getSpan(),1635 AtomicExpr new_node = ExprFactory.makeAtomicExpr(that.getSpan(), 1636 1636 that.isParenthesized(), 1637 1637 expr_result.type(), … … 2005 2005 } 2006 2006 2007 ChainExpr new_node = newChainExpr(that.getSpan(),2007 ChainExpr new_node = ExprFactory.makeChainExpr(that.getSpan(), 2008 2008 that.isParenthesized(), 2009 2009 Option.<Type>some(Types.BOOLEAN), … … 2145 2145 2146 2146 Type result_type = subtypeChecker.join(frontTypes); 2147 Do new_node = newDo(that.getSpan(),2147 Do new_node = ExprFactory.makeDo(that.getSpan(), 2148 2148 that.isParenthesized(), 2149 2149 some(result_type), … … 2279 2279 } 2280 2280 2281 FieldRef new_node = newFieldRef(that.getSpan(),2281 FieldRef new_node = ExprFactory.makeFieldRef(that.getSpan(), 2282 2282 that.isParenthesized(), 2283 2283 result_type, … … 2608 2608 TypeCheckerResult body_void = this.checkSubtype(body_result.type().unwrap(), Types.VOID, that.getBody(), err); 2609 2609 2610 For for_ = newFor(that.getSpan(),2610 For for_ = ExprFactory.makeFor(that.getSpan(), 2611 2611 that.isParenthesized(), 2612 2612 Option.<Type>some(Types.VOID), … … 2926 2926 labelExitTypes.remove(that.getName()); 2927 2927 2928 Label new_node = newLabel(that.getSpan(),2928 Label new_node = ExprFactory.makeLabel(that.getSpan(), 2929 2929 that.isParenthesized(), 2930 2930 labelType, … … 2953 2953 body_results.get(body_results.size()-1).type(); 2954 2954 2955 LetFn new_node = newLetFn(that.getSpan(),2955 LetFn new_node = ExprFactory.makeLetFn(that.getSpan(), 2956 2956 that.isParenthesized(), 2957 2957 body_type, … … 3029 3029 } 3030 3030 Expr arg = that.getExprs().get(1); 3031 _RewriteFnApp fnApp = new _RewriteFnApp(new Span(front.getSpan(), arg.getSpan()), 3032 front, arg); 3031 _RewriteFnApp fnApp = ExprFactory.make_RewriteFnApp(front, arg); 3033 3032 3034 3033 // Simulate a TypeCheckerResult for the front, giving it a fresh arrow type. … … 3210 3209 } 3211 3210 // Otherwise, make a new MathPrimary that is one element shorter, and recur 3212 _RewriteFnApp fn = new _RewriteFnApp(new Span(front.getSpan(), arg.getSpan()), 3213 front, 3214 ((ExprMI)arg).getExpr()); 3211 _RewriteFnApp fn = ExprFactory.make_RewriteFnApp(front, 3212 ((ExprMI)arg).getExpr()); 3215 3213 MathPrimary new_primary = ExprFactory.makeMathPrimary(that.getSpan(), 3216 3214 that.isParenthesized(), … … 3254 3252 item_iter.remove(); // remove fn from item list 3255 3253 // replace both with fn appication 3256 _RewriteFnApp fn = new _RewriteFnApp(new Span(front.getSpan(),arg.getSpan()),front, ((ExprMI)arg).getExpr());3254 _RewriteFnApp fn = ExprFactory.make_RewriteFnApp(front, ((ExprMI)arg).getExpr()); 3257 3255 item_iter.add(new NonParenthesisDelimitedMI(fn.getSpan(),fn)); 3258 3256 // static error if the argument is immediately followed by a non-expression element. … … 3916 3914 3917 3915 Type expr_type = Types.makeThreadType(bodyResult.type().unwrap()); 3918 Spawn new_node = newSpawn(that.getSpan(),3916 Spawn new_node = ExprFactory.makeSpawn(that.getSpan(), 3919 3917 that.isParenthesized(), 3920 3918 Option.<Type>some(expr_type), … … 3928 3926 @Override 3929 3927 public TypeCheckerResult forStringLiteralExpr(StringLiteralExpr that) { 3930 StringLiteralExpr new_node = newStringLiteralExpr(that.getSpan(),3928 StringLiteralExpr new_node = ExprFactory.makeStringLiteralExpr(that.getSpan(), 3931 3929 that.isParenthesized(), 3932 3930 Option.<Type>some(Types.STRING), … … 3994 3992 "This expression is of type " + expr_result.type().unwrap()); 3995 3993 3996 Throw new_node = newThrow(that.getSpan(),3994 Throw new_node = ExprFactory.makeThrow(that.getSpan(), 3997 3995 that.isParenthesized(), 3998 3996 Option.<Type>some(Types.BOTTOM), … … 4115 4113 errorMsg("A 'spawn' expression must not occur inside a 'try atomic' expression.")); 4116 4114 4117 TryAtomicExpr new_node = newTryAtomicExpr(that.getSpan(),4115 TryAtomicExpr new_node = ExprFactory.makeTryAtomicExpr(that.getSpan(), 4118 4116 that.isParenthesized(), 4119 4117 expr_result.type(), … … 4228 4226 @Override 4229 4227 public Node forAsExpr(AsExpr that) { 4230 return newAsExpr(that.getSpan(), that.isParenthesized(), some(annotatedType),4231 (Expr)expr_result.ast(), annotatedType);4228 return ExprFactory.makeAsExpr(that.getSpan(), that.isParenthesized(), some(annotatedType), 4229 (Expr)expr_result.ast(), annotatedType); 4232 4230 } 4233 4231 4234 4232 @Override 4235 4233 public Node forAsIfExpr(AsIfExpr that) { 4236 return newAsIfExpr(that.getSpan(), that.isParenthesized(), some(annotatedType),4234 return ExprFactory.makeAsIfExpr(that.getSpan(), that.isParenthesized(), some(annotatedType), 4237 4235 (Expr)expr_result.ast(), annotatedType); 4238 4236 } … … 4504 4502 TypeCheckerResult void_result = this.checkSubtype(body_result.type().unwrap(), Types.VOID, that.getBody(), void_err); 4505 4503 4506 While new_node = newWhile(that.getSpan(),4504 While new_node = ExprFactory.makeWhile(that.getSpan(), 4507 4505 that.isParenthesized(), 4508 4506 Option.<Type>some(Types.VOID), -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/Evaluator.java
r3189 r3200 364 364 } 365 365 if (f.isAtomicBlock()) 366 return forAtomicExpr(new AtomicExpr(x.getSpan(), false, 367 f)); 366 return forAtomicExpr(ExprFactory.makeAtomicExpr(x.getSpan(), f)); 368 367 return f.accept(new Evaluator(this)); 369 368 } … … 377 376 } 378 377 if (f.isAtomicBlock()) 379 tasks[i] = new TupleTask(new AtomicExpr(x.getSpan(), false, 380 f), this); 378 tasks[i] = new TupleTask(ExprFactory.makeAtomicExpr(x.getSpan(), f), this); 381 379 else 382 380 tasks[i] = new TupleTask(f, new Evaluator(this)); -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/_WrappedFValue.java
r3142 r3200 39 39 */ 40 40 public _WrappedFValue(Span in_span, boolean in_is_parenthesized, FValue in_fValue) { 41 super( in_span, in_is_parenthesized);41 super(); 42 42 if (in_fValue == null) { 43 43 throw new java.lang.IllegalArgumentException("Parameter 'fValue' to the _WrappedFValue constructor was null"); -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java
r3199 r3200 218 218 @Override 219 219 Expr replacement(VarRef original) { 220 return new FieldRef(original.getSpan(), false,220 return ExprFactory.makeFieldRef(original.getSpan(), 221 221 // Use this constructor 222 222 // here because it is a … … 457 457 } 458 458 if (i > 0) { 459 return new FieldRef(s, false, dottedReference(s, i - 1),460 new Id(s,WellKnownNames.secretParentName));459 return ExprFactory.makeFieldRef(s, dottedReference(s, i - 1), 460 new Id(s,WellKnownNames.secretParentName)); 461 461 } else { 462 462 throw new Error("Confusion in member reference numbering."); … … 920 920 Option<Type> type = lv.getIdType(); 921 921 newdecls.add(new VarDecl(at, Useful.list(lv), 922 Option.<Expr>some( new FieldRef(at, false, init, newName))));922 Option.<Expr>some(ExprFactory.makeFieldRef(at, init, newName)))); 923 923 element_index++; 924 924 } … … 960 960 objectExprs.add(rwoe); 961 961 962 return visitNode(new _RewriteObjectExprRef(rwoe.getSpan(), rwoe.isParenthesized(), rwoe.getExprType(), rwoe.getGenSymName(), rwoe.getStaticArgs())); 962 return visitNode(new _RewriteObjectExprRef(rwoe.getSpan(), 963 rwoe.isParenthesized(), 964 rwoe.getExprType(), 965 rwoe.getGenSymName(), 966 rwoe.getStaticArgs())); 963 967 } 964 968 … … 1099 1103 public Node forFor(For f) { 1100 1104 Block df = f.getBody(); 1101 Do doBlock = newDo(df.getSpan(),Useful.list(df));1105 Do doBlock = ExprFactory.makeDo(df.getSpan(),Useful.list(df)); 1102 1106 return visitLoop(f.getSpan(), f.getGens(), doBlock); 1103 1107 } -
trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ExprFactory.java
r3199 r3200 977 977 public static If makeIf(Span sp, IfClause _if) { 978 978 List<IfClause> ifclauses = Collections.singletonList(_if); 979 return newIf(sp, ifclauses, Option.<Block>none());979 return makeIf(sp, ifclauses, Option.<Block>none()); 980 980 } 981 981 … … 1026 1026 equalsOp, inOp, clauses, elseClause); 1027 1027 } 1028 1029 public static ChainExpr makeChainExpr(Expr e, Op _op, Expr _expr) { 1030 List<Link> links = new ArrayList<Link>(1); 1031 Link link = new Link(NodeFactory.makeSpan(_op, _expr), makeOpRef(NodeFactory.makeOpInfix(_op)), _expr); 1032 links.add(link); 1033 return makeChainExpr(NodeFactory.makeSpan(e, _expr), e, links); 1034 } 1035 1036 public static ChainExpr makeChainExpr(Span sp, Expr e, Op _op, Expr _expr) { 1037 List<Link> links = new ArrayList<Link>(1); 1038 Link link = new Link(NodeFactory.makeSpan(_op, _expr), 1039 makeOpRef(NodeFactory.makeOpInfix(_op)), _expr); 1040 links.add(link); 1041 return makeChainExpr(sp, e, links); 1042 } 1043 1044 public static ChainExpr makeChainExpr(Span span, 1045 Expr first, List<Link> links) { 1046 return makeChainExpr(span, false, Option.<Type>none(), first, links); 1047 } 1048 1049 public static ChainExpr makeChainExpr(Span span, 1050 boolean parenthesized, 1051 Option<Type> exprType, 1052 Expr first, List<Link> links) { 1053 return new ChainExpr(span, parenthesized, exprType, first, links); 1054 } 1055 1056 public static _RewriteFnApp make_RewriteFnApp(Expr e_1, Expr e_2) { 1057 return make_RewriteFnApp(FortressUtil.spanTwo(e_1, e_2), false, 1058 Option.<Type>none(), e_1, e_2); 1059 } 1060 1061 public static _RewriteFnApp make_RewriteFnApp(Span span, 1062 boolean parenthesized, 1063 Option<Type> exprType, 1064 Expr function, 1065 Expr argument) { 1066 return new _RewriteFnApp(span, parenthesized, exprType, function, 1067 argument); 1068 } 1069 1070 public static FieldRef makeFieldRef(FieldRef expr, Span span) { 1071 return makeFieldRef(span, expr.isParenthesized(), 1072 expr.getExprType(), expr.getObj(), expr.getField()); 1073 } 1074 1075 public static FieldRef makeFieldRef(FieldRef expr, Expr receiver, Id field) { 1076 return makeFieldRef(expr.getSpan(), expr.isParenthesized(), 1077 expr.getExprType(), receiver, field); 1078 } 1079 1080 public static FieldRef make_RewriteFieldRef(FieldRef expr, 1081 Expr receiver, Id field) { 1082 return makeFieldRef(expr.getSpan(), expr.isParenthesized(), 1083 expr.getExprType(), receiver, field); 1084 } 1085 1086 public static FieldRef makeFieldRef(Span span, Expr receiver, Id field) { 1087 return makeFieldRef(span, false, Option.<Type>none(), receiver, field); 1088 } 1089 1090 public static FieldRef makeFieldRef(Expr receiver, Id field) { 1091 return makeFieldRef(FortressUtil.spanTwo(receiver, field), receiver, field); 1092 } 1093 1094 public static FieldRef makeFieldRef(Span span, 1095 boolean parenthesized, 1096 Option<Type> exprType, 1097 Expr obj, Id field) { 1098 return new FieldRef(span, parenthesized, exprType, obj, field); 1099 } 1100 1101 public static AtomicExpr makeAtomicExpr(Span span, Expr expr) { 1102 return makeAtomicExpr(span, false, Option.<Type>none(), expr); 1103 } 1104 1105 public static AtomicExpr makeAtomicExpr(Span span, 1106 boolean parenthesized, 1107 Option<Type> exprType, 1108 Expr expr) { 1109 return new AtomicExpr(span, parenthesized, exprType, expr); 1110 } 1111 1112 public static For makeFor(Span span, 1113 List<GeneratorClause> gens, 1114 Block body) { 1115 return makeFor(span, false, Option.<Type>none(), gens, body); 1116 } 1117 1118 public static For makeFor(Span span, 1119 boolean parenthesized, 1120 Option<Type> exprType, 1121 List<GeneratorClause> gens, 1122 Block body) { 1123 return new For(span, parenthesized, exprType, gens, body); 1124 } 1125 1126 public static Spawn makeSpawn(Span span, 1127 Expr body) { 1128 return makeSpawn(span, false, Option.<Type>none(), body); 1129 } 1130 1131 public static Spawn makeSpawn(Span span, 1132 boolean parenthesized, 1133 Option<Type> exprType, 1134 Expr body) { 1135 return new Spawn(span, parenthesized, exprType, body); 1136 } 1137 1138 1139 public static TryAtomicExpr makeTryAtomicExpr(Span span, 1140 Expr expr) { 1141 return makeTryAtomicExpr(span, false, Option.<Type>none(), expr); 1142 } 1143 1144 public static TryAtomicExpr makeTryAtomicExpr(Span span, 1145 boolean parenthesized, 1146 Option<Type> exprType, 1147 Expr expr) { 1148 return new TryAtomicExpr(span, parenthesized, exprType, expr); 1149 } 1150 1151 public static LetFn makeLetFn(Span span, 1152 List<Expr> body, 1153 List<FnDecl> fns) { 1154 return makeLetFn(span, false, Option.<Type>none(), 1155 body, fns); 1156 } 1157 1158 public static LetFn makeLetFn(Span span, 1159 boolean parenthesized, 1160 Option<Type> exprType, 1161 List<Expr> body, 1162 List<FnDecl> fns) { 1163 return new LetFn(span, parenthesized, exprType, body, fns); 1164 } 1165 1166 public static Throw makeThrow(Span sp, String st) { 1167 Id id = NodeFactory.makeId(sp, WellKnownNames.fortressLibrary, st); 1168 return makeThrow(sp, makeVarRef(sp, id)); 1169 } 1170 1171 public static Throw makeThrow(Span span, 1172 Expr expr) { 1173 return makeThrow(span, false, Option.<Type>none(), expr); 1174 } 1175 1176 public static Throw makeThrow(Span span, 1177 boolean parenthesized, 1178 Option<Type> exprType, 1179 Expr expr) { 1180 return new Throw(span, parenthesized, exprType, expr); 1181 } 1182 1183 public static StringLiteralExpr makeStringLiteralExpr(Span span, String s) { 1184 return makeStringLiteralExpr(span, false, Option.<Type>none(), s); 1185 } 1186 1187 public static StringLiteralExpr makeStringLiteralExpr(Span span, 1188 boolean parenthesized, 1189 Option<Type> exprType, 1190 String text) { 1191 return new StringLiteralExpr(span, parenthesized, exprType, text); 1192 } 1193 1194 public static FloatLiteralExpr makeFloatLiteralExpr(Span span, 1195 boolean parenthesized, 1196 Option<Type> exprType, 1197 String text, 1198 BigInteger intPart, 1199 BigInteger numerator, 1200 int denomBase, 1201 int denomPower) { 1202 return new FloatLiteralExpr(span, parenthesized, exprType, text, 1203 intPart, numerator, denomBase, denomPower); 1204 } 1205 1206 public static AsExpr makeAsExpr(Span span, 1207 Expr expr, Type annType) { 1208 return makeAsExpr(span, false, Option.<Type>none(), expr, annType); 1209 } 1210 1211 public static AsExpr makeAsExpr(Span span, 1212 boolean parenthesized, 1213 Option<Type> exprType, 1214 Expr expr, Type annType) { 1215 return new AsExpr(span, parenthesized, exprType, expr, annType); 1216 } 1217 1218 public static AsIfExpr makeAsIfExpr(Span span, 1219 Expr expr, Type annType) { 1220 return makeAsIfExpr(span, false, Option.<Type>none(), expr, annType); 1221 } 1222 1223 public static AsIfExpr makeAsIfExpr(Span span, 1224 boolean parenthesized, 1225 Option<Type> exprType, 1226 Expr expr, Type annType) { 1227 return new AsIfExpr(span, parenthesized, exprType, expr, annType); 1228 } 1229 1230 public static While makeWhile(Span sp, Expr cond) { 1231 // Might not work; empty Do may be naughty. 1232 return makeWhile(sp, makeGeneratorClause(cond.getSpan(), cond), 1233 makeDo(sp, Collections.<Block>emptyList())); 1234 } 1235 1236 public static While makeWhile(Span span, 1237 GeneratorClause testExpr, 1238 Do body) { 1239 return makeWhile(span, false, Option.<Type>none(), 1240 testExpr, body); 1241 } 1242 1243 public static While makeWhile(Span span, 1244 boolean parenthesized, 1245 Option<Type> exprType, 1246 GeneratorClause testExpr, 1247 Do body) { 1248 return new While(span, parenthesized, exprType, testExpr, body); 1249 } 1250 1251 public static Label makeLabel(Span span, 1252 Id name, Block body) { 1253 return makeLabel(span, false, Option.<Type>none(), name, body); 1254 } 1255 1256 public static Label makeLabel(Span span, 1257 boolean parenthesized, 1258 Option<Type> exprType, 1259 Id name, Block body) { 1260 return new Label(span, parenthesized, exprType, name, body); 1261 } 1262 1263 public static Do makeDo(Span sp, Option<Type> t, Expr e) { 1264 List<Expr> b = Collections.singletonList(e); 1265 List<Block> body = new ArrayList<Block>(1); 1266 body.add(makeBlock(sp, t, false, true, b)); 1267 return makeDo(sp, false, t, body); 1268 } 1269 1270 public static Do makeDo(Span sp, Option<Type> t, List<Expr> exprs) { 1271 List<Block> body = new ArrayList<Block>(1); 1272 body.add(makeBlock(sp, t, false, true, exprs)); 1273 return makeDo(sp, false, t, body); 1274 } 1275 1276 public static Do makeDo(Span span, 1277 List<Block> fronts) { 1278 return makeDo(span, false, Option.<Type>none(), fronts); 1279 } 1280 1281 public static Do makeDo(Span span, 1282 boolean parenthesized, 1283 Option<Type> exprType, 1284 List<Block> fronts) { 1285 return new Do(span, parenthesized, exprType, fronts); 1286 } 1287 1288 1028 1289 1029 1290 /* … … 1127 1388 } 1128 1389 } 1129 return new FloatLiteralExpr(span, false, s,1130 intPart, numerator, denomBase, denomPower);1390 return makeFloatLiteralExpr(span, false, Option.<Type>none(), s, 1391 intPart, numerator, denomBase, denomPower); 1131 1392 } 1132 1393 … … 1134 1395 return let_expr.accept(new NodeAbstractVisitor<LetExpr>() { 1135 1396 public LetExpr forLetFn(LetFn expr) { 1136 return new LetFn(expr.getSpan(),false, body, expr.getFns());1397 return ExprFactory.makeLetFn(expr.getSpan(), body, expr.getFns()); 1137 1398 } 1138 1399 public LetExpr forLocalVarDecl(LocalVarDecl expr) { … … 1169 1430 } 1170 1431 1171 public static StringLiteralExpr makeStringLiteralExpr(Span span, String s) {1172 return new StringLiteralExpr(span, s);1173 }1174 1175 public static FieldRef makeFieldRef(FieldRef expr, Span span) {1176 return new FieldRef(span, expr.isParenthesized(),1177 expr.getExprType(), expr.getObj(), expr.getField());1178 }1179 1180 public static FieldRef makeFieldRef(FieldRef expr, Expr receiver, Id field) {1181 return new FieldRef(expr.getSpan(), expr.isParenthesized(),1182 expr.getExprType(), receiver, field);1183 }1184 1185 public static FieldRef make_RewriteFieldRef(FieldRef expr,1186 Expr receiver, Id field) {1187 return new FieldRef(expr.getSpan(), expr.isParenthesized(),1188 expr.getExprType(), receiver, field);1189 }1190 1191 public static FieldRef makeFieldRef(Span span, Expr receiver, Id field) {1192 return new FieldRef(span, receiver, field);1193 }1194 1195 public static FieldRef makeFieldRef(Expr receiver, Id field) {1196 return new FieldRef(FortressUtil.spanTwo(receiver, field), false,1197 receiver, field);1198 }1199 1200 1432 public static Expr makeReceiver(Iterable<Id> ids) { 1201 1433 Expr expr = makeVarRef(IterUtil.first(ids)); … … 1206 1438 } 1207 1439 1208 public static While makeWhile(Span sp, Expr cond) {1209 // Might not work; empty Do may be naughty.1210 return new While(sp, makeGeneratorClause(cond.getSpan(), cond),1211 new Do(sp, Collections.<Block>emptyList()));1212 }1213 1214 public static Do makeDo(Span sp, Option<Type> t, Expr e) {1215 List<Expr> b = Collections.singletonList(e);1216 List<Block> body = new ArrayList<Block>(1);1217 body.add(makeBlock(sp, t, false, true, b));1218 return new Do(sp, t, body);1219 }1220 1221 public static Do makeDo(Span sp, Option<Type> t, List<Expr> exprs) {1222 List<Block> body = new ArrayList<Block>(1);1223 body.add(makeBlock(sp, t, false, true, exprs));1224 return new Do(sp, t, body);1225 }1226 1227 public static ChainExpr makeChainExpr(Expr e, Op _op, Expr _expr) {1228 List<Link> links = new ArrayList<Link>(1);1229 Link link = new Link(NodeFactory.makeSpan(_op, _expr), makeOpRef(NodeFactory.makeOpInfix(_op)), _expr);1230 links.add(link);1231 return new ChainExpr(NodeFactory.makeSpan(e, _expr), e, links);1232 }1233 1234 public static ChainExpr makeChainExpr(Span sp, Expr e, Op _op, Expr _expr) {1235 List<Link> links = new ArrayList<Link>(1);1236 Link link = new Link(NodeFactory.makeSpan(_op, _expr), makeOpRef(NodeFactory.makeOpInfix(_op)), _expr);1237 links.add(link);1238 return new ChainExpr(sp, e, links);1239 }1240 1241 /**1242 * Throws a standard (FortressLibrary) exception1243 * @param sp1244 * @param st1245 * @return1246 */1247 public static Throw makeThrow(Span sp, String st) {1248 Id id = NodeFactory.makeId(sp, WellKnownNames.fortressLibrary, st);1249 return new Throw(sp, makeVarRef(sp, id));1250 }1251 1252 /**1253 * Uses the Spans from e_1 and e_2.1254 */1255 public static _RewriteFnApp make_RewriteFnApp(Expr e_1, Expr e_2) {1256 return new _RewriteFnApp(FortressUtil.spanTwo(e_1, e_2), e_1, e_2);1257 }1258 1259 1440 public static Expr makeInParentheses(Expr expr) { 1260 1441 return expr.accept(new NodeAbstractVisitor<Expr>() { 1261 1442 @Override 1262 1443 public Expr for_RewriteFnApp(_RewriteFnApp that) { 1263 return new _RewriteFnApp(that.getSpan(),true,that.getFunction(),that.getArgument()); 1444 return make_RewriteFnApp(that.getSpan(), true, that.getExprType(), 1445 that.getFunction(), that.getArgument()); 1264 1446 } 1265 1447 public Expr forAsExpr(AsExpr e) { 1266 return new AsExpr(e.getSpan(), true, e.getExpr(), e.getAnnType()); 1448 return makeAsExpr(e.getSpan(), true, e.getExprType(), 1449 e.getExpr(), e.getAnnType()); 1267 1450 } 1268 1451 public Expr forAsIfExpr(AsIfExpr e) { 1269 return new AsIfExpr(e.getSpan(), true, e.getExpr(), e.getAnnType()); 1452 return makeAsIfExpr(e.getSpan(), true, e.getExprType(), 1453 e.getExpr(), e.getAnnType()); 1270 1454 } 1271 1455 … … 1285 1469 } 1286 1470 public Expr forDo(Do e) { 1287 return new Do(e.getSpan(), true, e.getFronts());1471 return makeDo(e.getSpan(), true, e.getExprType(), e.getFronts()); 1288 1472 } 1289 1473 public Expr forFor(For e) { 1290 return new For(e.getSpan(), true, e.getGens(), e.getBody()); 1474 return makeFor(e.getSpan(), true, e.getExprType(), e.getGens(), 1475 e.getBody()); 1291 1476 } 1292 1477 public Expr forIf(If e) { 1293 return new If(e.getSpan(), true, e.getClauses(),1294 e.getElseClause());1478 return makeIf(e.getSpan(), true, e.getExprType(), 1479 e.getClauses(), e.getElseClause()); 1295 1480 } 1296 1481 public Expr forLabel(Label e) { 1297 return new Label(e.getSpan(), true, e.getName(), e.getBody()); 1482 return makeLabel(e.getSpan(), true, e.getExprType(), 1483 e.getName(), e.getBody()); 1298 1484 } 1299 1485 public Expr forMathPrimary(MathPrimary e) { … … 1308 1494 public Expr for_RewriteObjectExpr(_RewriteObjectExpr e) { 1309 1495 return new _RewriteObjectExpr(e.getSpan(), true, 1496 e.getExprType(), 1310 1497 e.getExtendsClause(), e.getDecls(), 1311 1498 e.getImplicitTypeParameters(), … … 1330 1517 } 1331 1518 public Expr forWhile(While e) { 1332 return new While(e.getSpan(), true, e.getTestExpr(), e.getBody()); 1519 return makeWhile(e.getSpan(), true, e.getExprType(), 1520 e.getTestExpr(), e.getBody()); 1333 1521 } 1334 1522 public Expr forAccumulator(Accumulator e) { … … 1338 1526 } 1339 1527 public Expr forAtomicExpr(AtomicExpr e) { 1340 return new AtomicExpr(e.getSpan(), true, e.getExpr());1528 return makeAtomicExpr(e.getSpan(), true, e.getExprType(), e.getExpr()); 1341 1529 } 1342 1530 public Expr forExit(Exit e) { … … 1346 1534 1347 1535 public Expr forSpawn(Spawn e) { 1348 return new Spawn(e.getSpan(), true, e.getBody());1536 return makeSpawn(e.getSpan(), true, e.getExprType(), e.getBody()); 1349 1537 } 1350 1538 public Expr forThrow(Throw e) { 1351 return new Throw(e.getSpan(), true, e.getExpr());1539 return makeThrow(e.getSpan(), true, e.getExprType(), e.getExpr()); 1352 1540 } 1353 1541 public Expr forTryAtomicExpr(TryAtomicExpr e) { 1354 return new TryAtomicExpr(e.getSpan(), true, e.getExpr()); 1542 return makeTryAtomicExpr(e.getSpan(), true, e.getExprType(), 1543 e.getExpr()); 1355 1544 } 1356 1545 public Expr forFnExpr(FnExpr e) { … … 1361 1550 } 1362 1551 public Expr forLetFn(LetFn e) { 1363 return new LetFn(e.getSpan(), true, e.getBody(), e.getFns());1552 return makeLetFn(e.getSpan(), true, e.getExprType(), e.getBody(), e.getFns()); 1364 1553 } 1365 1554 public Expr forLocalVarDecl(LocalVarDecl e) { … … 1386 1575 } 1387 1576 public Expr forFloatLiteralExpr(FloatLiteralExpr e) { 1388 return new FloatLiteralExpr(e.getSpan(), true, e.getText(), 1577 return makeFloatLiteralExpr(e.getSpan(), true, e.getExprType(), 1578 e.getText(), 1389 1579 e.getIntPart(), e.getNumerator(), 1390 1580 e.getDenomBase(), e.getDenomPower()); … … 1399 1589 } 1400 1590 public Expr forStringLiteralExpr(StringLiteralExpr e) { 1401 return new StringLiteralExpr(e.getSpan(), true, e.getText()); 1591 return makeStringLiteralExpr(e.getSpan(), true, e.getExprType(), 1592 e.getText()); 1402 1593 } 1403 1594 public Expr forVoidLiteralExpr(VoidLiteralExpr e) { … … 1414 1605 } 1415 1606 public Expr forChainExpr(ChainExpr e) { 1416 return new ChainExpr(e.getSpan(), true, e.getFirst(),1417 e.getLinks());1607 return makeChainExpr(e.getSpan(), true, e.getExprType(), e.getFirst(), 1608 e.getLinks()); 1418 1609 } 1419 1610 public Expr forFieldRef(FieldRef e) { 1420 return new FieldRef(e.getSpan(), true, e.getObj(),1421 e.getField());1611 return makeFieldRef(e.getSpan(), true, e.getExprType(), 1612 e.getObj(), e.getField()); 1422 1613 } 1423 1614 public Expr forMethodInvocation(MethodInvocation e) { -
trunk/ProjectFortress/src/com/sun/fortress/parser/DelimitedExpr.rats
r3199 r3200 66 66 a1 + "' at " + a1.getSpan() + " and\n'" + 67 67 a3 + "' at " + a3.getSpan()); 68 yyValue = new Label(createSpan(yyStart,yyCount), false, a1, a2);68 yyValue = ExprFactory.makeLabel(createSpan(yyStart,yyCount), a1, a2); 69 69 } 70 70 / <ErrorProduction> … … 82 82 } 83 83 / while w a1:GeneratorClause w a2:Do 84 { yyValue = new While(createSpan(yyStart,yyCount), false, a1, a2); }84 { yyValue = ExprFactory.makeWhile(createSpan(yyStart,yyCount), a1, a2); } 85 85 / for w a1:GeneratorClauseList w a2:DoFront w end 86 { yyValue = new For(createSpan(yyStart,yyCount), false, a1, a2); }86 { yyValue = ExprFactory.makeFor(createSpan(yyStart,yyCount), a1, a2); } 87 87 / if w a1:GeneratorClause w then w a2:BlockElems a3:(w Elifs)? a4:(w Else)? w end 88 88 { IfClause ic = new IfClause(FortressUtil.spanTwo(a1,a2), a1, a2); … … 164 164 /* Do ::= (DoFront w also w)* DoFront w end */ 165 165 Do Do = a1s:(DoFront w also w)* a2:DoFront w end 166 { yyValue = new Do(createSpan(yyStart, yyCount), false,167 FortressUtil.mkList(a1s.list(), a2));166 { yyValue = ExprFactory.makeDo(createSpan(yyStart, yyCount), 167 FortressUtil.mkList(a1s.list(), a2)); 168 168 }; 169 169 -
trunk/ProjectFortress/src/com/sun/fortress/parser/Expression.rats
r3199 r3200 68 68 { yyValue = new Action<Expr>() { 69 69 public Expr run(Expr base) { 70 return new AsExpr(createSpan(yyStart,yyCount), false, (Expr)base,71 a1);70 return ExprFactory.makeAsExpr(createSpan(yyStart,yyCount), (Expr)base, 71 a1); 72 72 }}; 73 73 }; … … 77 77 { yyValue = new Action<Expr>() { 78 78 public Expr run(Expr base) { 79 return new AsIfExpr(createSpan(yyStart,yyCount), false,80 (Expr)base, a1);79 return ExprFactory.makeAsIfExpr(createSpan(yyStart,yyCount), 80 (Expr)base, a1); 81 81 }}; 82 82 }; … … 691 691 } 692 692 / atomic w a1:AtomicBack 693 { yyValue = new AtomicExpr(createSpan(yyStart,yyCount), false, a1); }693 { yyValue = ExprFactory.makeAtomicExpr(createSpan(yyStart,yyCount), a1); } 694 694 / tryatomic w a1:AtomicBack 695 { yyValue = new TryAtomicExpr(createSpan(yyStart,yyCount), false, a1); }695 { yyValue = ExprFactory.makeTryAtomicExpr(createSpan(yyStart,yyCount), a1); } 696 696 / spawn w a1:Expr 697 { yyValue = new Spawn(createSpan(yyStart,yyCount), false, a1); }697 { yyValue = ExprFactory.makeSpawn(createSpan(yyStart,yyCount), a1); } 698 698 / throw w a1:Expr 699 { yyValue = new Throw(createSpan(yyStart,yyCount), false, a1); };699 { yyValue = ExprFactory.makeThrow(createSpan(yyStart,yyCount), a1); }; 700 700 701 701 /* AtomicBack ::= -
trunk/ProjectFortress/src/com/sun/fortress/parser/Literal.rats
r3187 r3200 175 175 str = str.concat(c); 176 176 } 177 yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str);177 yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 178 178 } 179 179 / "\u201c" a1:StringLiteralContent* "\u201d" … … 182 182 str = str.concat(c); 183 183 } 184 yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str);184 yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 185 185 } 186 186 / <ErrorProduction1> ["] a1:StringLiteralContent* "\u201d" 187 187 { Span span = createSpan(yyStart,yyCount); 188 188 log(span, "The opening and closing marks of a string literal must match."); 189 yyValue = new StringLiteralExpr(span, false, "");189 yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 190 190 } 191 191 / <ErrorProduction2> "\u201c" a1:StringLiteralContent* ["] 192 192 { Span span = createSpan(yyStart,yyCount); 193 193 log(span, "The opening and closing marks of a string literal must match."); 194 yyValue = new StringLiteralExpr(span, false, "");194 yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 195 195 }; 196 196 private String StringLiteralContent = -
trunk/ProjectFortress/src/com/sun/fortress/parser/LocalDecl.rats
r3198 r3200 65 65 / a1:NoNewlineExpr a2:(s comma w NoNewlineGeneratorClauseList)? 66 66 { if (a2 == null) yyValue = a1; 67 else yyValue = new For(createSpan(yyStart,yyCount), false,68 a2, ExprFactory.makeBlock(a1));67 else yyValue = ExprFactory.makeFor(createSpan(yyStart,yyCount), 68 a2, ExprFactory.makeBlock(a1)); 69 69 }; 70 70 … … 76 76 a1:LocalFnDecl a2s:(br LocalFnDecl)* 77 77 { List<FnDecl> fns = FortressUtil.mkList(a1, a2s.list()); 78 yyValue = new LetFn(createSpan(yyStart,yyCount), false,78 yyValue = ExprFactory.makeLetFn(createSpan(yyStart,yyCount), 79 79 FortressUtil.emptyExprs(), fns); 80 80 } -
trunk/ProjectFortress/src/com/sun/fortress/parser/NoNewlineExpr.rats
r3199 r3200 69 69 yyValue = new Action<Expr>() { 70 70 public Expr run(Expr base) { 71 return new AsExpr(createSpan(yyStart,yyCount), false, (Expr)base,72 t);71 return ExprFactory.makeAsExpr(createSpan(yyStart,yyCount), (Expr)base, 72 t); 73 73 }}; 74 74 }; … … 79 79 yyValue = new Action<Expr>() { 80 80 public Expr run(Expr base) { 81 return new AsIfExpr(createSpan(yyStart,yyCount), false,82 (Expr)base, t);81 return ExprFactory.makeAsIfExpr(createSpan(yyStart,yyCount), 82 (Expr)base, t); 83 83 }}; 84 84 }; -
trunk/ProjectFortress/src/com/sun/fortress/parser/preparser/PreCompilation.rats
r3184 r3200 149 149 str = str.concat(c); 150 150 } 151 yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str);151 yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 152 152 } 153 153 / "\u201c" a1:StringLiteralContent* "\u201d" … … 156 156 str = str.concat(c); 157 157 } 158 yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str);158 yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 159 159 } 160 160 / <ErrorProduction1> ["] a1:StringLiteralContent* "\u201d" 161 161 { Span span = createSpan(yyStart,yyCount); 162 162 log(span, "The opening and closing marks of a string literal must match."); 163 yyValue = new StringLiteralExpr(span, false, "");163 yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 164 164 } 165 165 / <ErrorProduction2> "\u201c" a1:StringLiteralContent* ["] 166 166 { Span span = createSpan(yyStart,yyCount); 167 167 log(span, "The opening and closing marks of a string literal must match."); 168 yyValue = new StringLiteralExpr(span, false, "");168 yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 169 169 }; 170 170 private String StringLiteralContent = -
trunk/ProjectFortress/src/com/sun/fortress/parser_util/precedence_resolver/ASTUtil.java
r3191 r3200 123 123 // chain_expr_links = links; })) 124 124 static Expr chain(Span span, Expr first, List<Link> links) { 125 return new ChainExpr(span, false, first, links);125 return ExprFactory.makeChainExpr(span, first, links); 126 126 } 127 127 -
trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/ComposingSyntaxDefTranslator.java
r3142 r3200 588 588 indents.add(3); 589 589 code.add("StringLiteralExpr " + prefixJavaVariable(name) + 590 " = newStringLiteralExpr(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), \"\"+" + prefixJavaVariable(id) + ");");590 " = ExprFactory.makeStringLiteralExpr(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), \"\"+" + prefixJavaVariable(id) + ");"); 591 591 return name; 592 592 } -
trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/EllipsesJUTest.java
r3199 r3200 57 57 original = ExprFactory.makeTightJuxt(new Span(), exprs); 58 58 EllipsesEnvironment env = new EllipsesEnvironment(); 59 env.add( NodeFactory.makeId( "x" ), 1, mkList( newStringLiteralExpr(span, "hello" )) );59 env.add( NodeFactory.makeId( "x" ), 1, mkList(ExprFactory.makeStringLiteralExpr(span, "hello" )) ); 60 60 actual = original.accept( new EllipsesVisitor( env ) ); 61 61 } … … 63 63 { 64 64 List<Expr> exprs = new ArrayList<Expr>(); 65 exprs.add( newStringLiteralExpr(span, "hello" ) );65 exprs.add( ExprFactory.makeStringLiteralExpr(span, "hello" ) ); 66 66 expected = ExprFactory.makeTightJuxt( new Span(), exprs ); 67 67 } … … 79 79 original = ExprFactory.makeTightJuxt(new Span(), exprs); 80 80 EllipsesEnvironment env = new EllipsesEnvironment(); 81 env.add( NodeFactory.makeId( "x" ), 1, mkList( new StringLiteralExpr(span, "hello" ), newStringLiteralExpr(span, "goodbye" ) ) );81 env.add( NodeFactory.makeId( "x" ), 1, mkList(ExprFactory.makeStringLiteralExpr(span, "hello" ), ExprFactory.makeStringLiteralExpr(span, "goodbye" ) ) ); 82 82 actual = original.accept( new EllipsesVisitor( env ) ); 83 83 } … … 85 85 { 86 86 expected = ExprFactory.makeTightJuxt( new Span(), 87 newStringLiteralExpr(span, "hello" ),88 newStringLiteralExpr(span, "goodbye" ) );87 ExprFactory.makeStringLiteralExpr(span, "hello" ), 88 ExprFactory.makeStringLiteralExpr(span, "goodbye" ) ); 89 89 } 90 90 … … 99 99 { 100 100 List<Expr> blocks = new ArrayList<Expr>(); 101 blocks.add( newStringLiteralExpr(span, "hi" ) );101 blocks.add( ExprFactory.makeStringLiteralExpr(span, "hi" ) ); 102 102 blocks.add( mkTemplate( "x" ) ); 103 103 Expr extra = ExprFactory.makeBlock(span, blocks ); … … 106 106 original = ExprFactory.makeTightJuxt(new Span(), exprs ); 107 107 EllipsesEnvironment env = new EllipsesEnvironment(); 108 env.add( NodeFactory.makeId( "x" ), 1, mkList( new StringLiteralExpr(span, "a"), newStringLiteralExpr(span, "b" ) ) );108 env.add( NodeFactory.makeId( "x" ), 1, mkList( ExprFactory.makeStringLiteralExpr(span, "a"), ExprFactory.makeStringLiteralExpr(span, "b" ) ) ); 109 109 actual = original.accept( new EllipsesVisitor( env ) ); 110 110 } … … 112 112 { 113 113 List<Expr> exprs = new ArrayList<Expr>(); 114 exprs.add( ExprFactory.makeBlock(span, mkExprList( newStringLiteralExpr(span, "hi" ),115 newStringLiteralExpr(span, "a" ) ) ) );116 exprs.add( ExprFactory.makeBlock(span, mkExprList( newStringLiteralExpr(span, "hi" ),117 newStringLiteralExpr(span, "b" ) ) ) );114 exprs.add( ExprFactory.makeBlock(span, mkExprList( ExprFactory.makeStringLiteralExpr(span, "hi" ), 115 ExprFactory.makeStringLiteralExpr(span, "a" ) ) ) ); 116 exprs.add( ExprFactory.makeBlock(span, mkExprList( ExprFactory.makeStringLiteralExpr(span, "hi" ), 117 ExprFactory.makeStringLiteralExpr(span, "b" ) ) ) ); 118 118 expected = ExprFactory.makeTightJuxt(new Span(), exprs ); 119 119 } … … 130 130 List<Expr> extra = mkExprList(mkTemplate("i"), mkTemplate("j")); 131 131 List<Expr> exprs = new ArrayList<Expr>(); 132 exprs.add( newStringLiteralExpr(span, "bar" ) );132 exprs.add( ExprFactory.makeStringLiteralExpr(span, "bar" ) ); 133 133 exprs.add( new _EllipsesExpr(new Span(), ExprFactory.makeTightJuxt(new Span(), extra ) ) ); 134 134 original = ExprFactory.makeTightJuxt(new Span(), exprs ); 135 135 EllipsesEnvironment env = new EllipsesEnvironment(); 136 env.add( NodeFactory.makeId( "i" ), 0, newStringLiteralExpr(span, "a" ) );137 env.add( NodeFactory.makeId( "j" ), 1, mkList( newStringLiteralExpr(span, "1" ),138 newStringLiteralExpr(span, "2" ),139 newStringLiteralExpr(span, "3" ) ) );136 env.add( NodeFactory.makeId( "i" ), 0, ExprFactory.makeStringLiteralExpr(span, "a" ) ); 137 env.add( NodeFactory.makeId( "j" ), 1, mkList( ExprFactory.makeStringLiteralExpr(span, "1" ), 138 ExprFactory.makeStringLiteralExpr(span, "2" ), 139 ExprFactory.makeStringLiteralExpr(span, "3" ) ) ); 140 140 actual = original.accept( new EllipsesVisitor( env ) ); 141 141 } … … 143 143 { 144 144 expected = ExprFactory.makeTightJuxt(new Span(), 145 mkExprList( newStringLiteralExpr(span, "bar" ),145 mkExprList( ExprFactory.makeStringLiteralExpr(span, "bar" ), 146 146 ExprFactory.makeTightJuxt(new Span(), 147 newStringLiteralExpr(span, "a"),148 newStringLiteralExpr(span, "1")),147 ExprFactory.makeStringLiteralExpr(span, "a"), 148 ExprFactory.makeStringLiteralExpr(span, "1")), 149 149 ExprFactory.makeTightJuxt(new Span(), 150 newStringLiteralExpr(span, "a"),151 newStringLiteralExpr(span, "2")),150 ExprFactory.makeStringLiteralExpr(span, "a"), 151 ExprFactory.makeStringLiteralExpr(span, "2")), 152 152 ExprFactory.makeTightJuxt(new Span(), 153 newStringLiteralExpr(span, "a"),154 newStringLiteralExpr(span, "3"))));153 ExprFactory.makeStringLiteralExpr(span, "a"), 154 ExprFactory.makeStringLiteralExpr(span, "3")))); 155 155 } 156 156 -
trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/Transform.java
r3199 r3200 235 235 Block body_result = (Block) recur(that.getBody()); 236 236 setSyntaxEnvironment(save); 237 return new Label(NodeFactory.makeSpan(that), exprType_result, newId, body_result); 237 return ExprFactory.makeLabel(NodeFactory.makeSpan(that), that.isParenthesized(), 238 exprType_result, newId, body_result); 238 239 } else { 239 240 return super.forLabel(that); -
trunk/ProjectFortress/src/com/sun/fortress/tests/unit_tests/ConstructorsJUTest.java
r3199 r3200 151 151 Span span1 = newSpan("cat", 1, 2, 3); 152 152 Span span2 = newSpan("cat", 1, 2, 3); 153 StringLiteralExpr sl1 = new StringLiteralExpr(span1, false, "123");154 StringLiteralExpr sl2 = new StringLiteralExpr(span2, false, "123");155 StringLiteralExpr sl3 = new StringLiteralExpr(span1, false, "124");153 StringLiteralExpr sl1 = ExprFactory.makeStringLiteralExpr(span1, "123"); 154 StringLiteralExpr sl2 = ExprFactory.makeStringLiteralExpr(span2, "123"); 155 StringLiteralExpr sl3 = ExprFactory.makeStringLiteralExpr(span1, "124"); 156 156 157 157 een(sl1, sl2, sl3); … … 181 181 StringLiteralExpr newString(String s) { 182 182 Span span1 = newSpan("cat", 1, 2, 3); 183 return new StringLiteralExpr(span1, false, s);183 return ExprFactory.makeStringLiteralExpr(span1, s); 184 184 } 185 185 IntLiteralExpr newInt(String s) {

