diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectDeclaration.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectDeclaration.rsc index ed19e4f7c40..807bb20f35e 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectDeclaration.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectDeclaration.rsc @@ -205,9 +205,8 @@ void collect(Tag tg, Collector c){ // Deprecated void collect(current: (Declaration) ` anno @ ;`, Collector c){ pname = prettyPrintName(name); - if(pname != "loc"){ - c.report(warning(current, "Annotations are deprecated, use keyword parameters instead")); - } + + c.report(warning(current, "Annotations are deprecated, use keyword fields instead")); tagsMap = getTags(tags); if(hasIgnoreCompilerTag(tagsMap)) { diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectExpression.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectExpression.rsc index 517aecf0f51..ca43490a3a5 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectExpression.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectExpression.rsc @@ -1072,7 +1072,7 @@ void collect(current: (Expression) ` [ // ---- fieldAccess void collect(current: (Expression) ` . `, Collector c){ - c.useViaType(expression, field, {fieldId(), keywordFieldId(), annoId()}); // DURING TRANSITION: allow annoIds + c.useViaType(expression, field, {fieldId(), keywordFieldId()}); c.require("non void or overloaded", expression, [], makeNonVoidNonOverloadedRequirement(expression, "Base expression of field selection")); c.fact(current, field); collect(expression, c); @@ -1238,12 +1238,15 @@ private AType do_computeSetAnnotationType(Tree current, AType t1, AType tn, ATyp return avalue(); } -// TODO: Deprecated void collect(current:(Expression) ` [ @ = ]`, Collector c) { pname = prettyPrintName(name); - if(pname != "loc"){ + if (pname == "loc") { + c.report(error(current, "The Tree@\\loc annotation has been replaced by the Tree.src keyword field.")); + } + else { c.report(warning(current, "Annotations are deprecated, use keyword parameters instead")); } + c.use(name, {annoId()}); c.calculate("set annotation", current, [expression, name, repl], AType(Solver s){ @@ -1275,9 +1278,14 @@ private AType do_computeGetAnnotationType(Tree current, AType t1, AType tn, Solv // TODO: Deprecated void collect(current:(Expression) `@`, Collector c) { pname = prettyPrintName(name); - if(pname != "loc"){ + + if (pname == "loc") { + c.report(error(current, "The Tree@\\loc annotation has been replaced by the Tree.src keyword field.")); + } + else { c.report(warning(current, "Annotations are deprecated, use keyword parameters instead")); } + c.use(name, {annoId()}); c.calculate("get annotation", current, [expression, name], AType(Solver s){ diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectStatement.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectStatement.rsc index 83f59dce12c..400912276ac 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectStatement.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectStatement.rsc @@ -667,6 +667,14 @@ void collect(current:(Assignable) `\< <{Assignable ","}+ elements> \>`, Collecto } void collect(current:(Assignable) ` @ `, Collector c){ + pname = prettyPrintName(annotation); + if (pname == "loc") { + c.report(error(current, "The Tree@\\loc annotation has been replaced by the Tree.src keyword field.")); + } + else { + c.report(warning(current, "Annotations are deprecated, use keyword parameters instead")); + } + collect(receiver, annotation, c); } @@ -1112,8 +1120,15 @@ private void checkAssignment(Statement current, receiver: (Assignable) `\< <{Ass //collect(elements, c); } -// TODO: Deprecated private void checkAssignment(Statement current, asg: (Assignable) ` @ `, str operator, Statement rhs, Collector c){ + pname = prettyPrintName(n); + if (pname == "loc") { + c.report(error(current, "The Tree@\\loc annotation has been replaced by the Tree.src keyword field.")); + } + else { + c.report(warning(current, "Annotations are deprecated, use keyword parameters instead")); + } + c.use(n, {annoId()}); names = getReceiver(receiver, c); c.useLub(names[0], variableRoles); diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectType.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectType.rsc index 602f1ff24b6..71bf3ffa424 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectType.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/CollectType.rsc @@ -571,7 +571,10 @@ void collect(current:(Sym) ` `, Collector c){ throw "Cannot compute md5 for "; } - // TODO require symbol is nonterminal + // NB: by induction a non-terminal role is already required for symbol: + // * either it is a Nonterminal name and the rule for Nonterminal covers this requirement + // * or it is a more complex Sym which are non-terminals by definition + c.define("", fieldId(), n, defType([symbol], AType(Solver s){ res = s.getType(symbol)[alabel=un]; diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/ComputeType.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/ComputeType.rsc index b873af3163f..a4723148b4d 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/ComputeType.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/ComputeType.rsc @@ -142,7 +142,15 @@ void(Solver) makeNonVoidRequirement(Tree t, str msg) void(Solver) makeNonVoidNonOverloadedRequirement(Tree t, str msg) = void(Solver s) { checkNonVoid(t, s, msg ); - if(isOverloadedAType(s.getType(t))) s.report(error(t, msg + " is ambiguous and should be resolved")); + AType resolution = s.getType(t); + + if (isOverloadedAType(resolution)) { + causes = + [ info("Candidate : .", pos) + | > <- zipi(resolution.overloads) + ]; + s.report(error(t, msg + " can not be resolved to a single type.", causes=causes)); + } }; AType unaryOp(str op, AType(Tree, AType, Solver) computeType, Tree current, AType t1, Solver s, bool maybeVoid=false){ diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/StaticTestingUtils.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/StaticTestingUtils.rsc index df71ace585e..609cf2ecc4c 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/StaticTestingUtils.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/StaticTestingUtils.rsc @@ -324,7 +324,7 @@ list[str] unexpectedTypeMsgs = [ "Expected a binary relation, found _", "Constructor _ is overloaded", "Expression _ is overloaded", - "Base expression of field selection is ambiguous and should be resolved" + "Base expression of field selection can not be resolved to a single type." ]; bool unexpectedTypeInModule(str moduleText, PathConfig pathConfig = getDefaultTestingPathConfig()) diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/SyntaxDeclarationTCTests.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/SyntaxDeclarationTCTests.rsc index 132e18b9318..2e41c9bd917 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/SyntaxDeclarationTCTests.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/SyntaxDeclarationTCTests.rsc @@ -629,4 +629,70 @@ test bool Issue1353() { import MC; value main() = hello(); "); +} + +test bool DoubleField() { + return checkModuleOK("module Exp + 'import ParseTree; + ' + 'layout L = [\\ \\t\\n]*; + ' + 'lexical Id = [a-z]; + ' + 'syntax Exp + ' = Id + ' | left Exp lhs \"*\" Exp rhs + ' \> left Exp lhs \"+\" Exp rhs + ' ; + ' + 'test bool expSrc() { + ' Exp tmp = (Exp) `a + b`; + ' Exp tmp2 = tmp.lhs; + ' return (Exp) `a` := tmp2; + '} + ' + 'test bool expLhsLhs() { + ' Exp tmp = (Exp) `a + b + c`; + ' Exp tmp2 = tmp.lhs; + ' Exp tmp3 = tmp.lhs.lhs; + ' return (Exp) `a` := tmp3; + '}"); +} + +test bool SyntaxFieldSrc() { + return checkModuleOK( + "module Exp + 'import ParseTree; + ' + 'layout L = [\\ \\t\\n]*; + ' + 'lexical Id = [a-z]; + ' + 'syntax Exp + ' = Id + ' | left Exp lhs \"*\" Exp rhs + ' \> left Exp lhs \"+\" Exp rhs + ' ; + ' + 'test bool expSrc() { + ' Exp tmp = (Exp) `a + b`; + ' return loc _ := tmp.src; + '} + ' + 'test bool expLhsSrc() { + ' Exp tmp = (Exp) `a + b + c`; + ' return loc _ := tmp.lhs.src; + '}"); +} + +test bool SyntaxFieldInRascalSyntax() { + return checkModuleOK( + "module RascalWithFunction + ' + 'import lang::rascal::\\syntax::Rascal; + 'import ParseTree; + ' + 'loc translateAddFunction(Expression e) { + ' return e.lhs.src; + '}"); } \ No newline at end of file diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalDeclaration.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalDeclaration.rsc index 3b0b3e885c6..cca68334fa5 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalDeclaration.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalDeclaration.rsc @@ -205,9 +205,7 @@ private void generateGettersForAdt(AType adtType, loc module_scope, set[AType] c str kwFieldName = unescape(kwType.alabel); if(kwFieldName in generated_common_getters) continue; generated_common_getters += kwFieldName; - if(asubtype(adtType, treeType)){ - if(kwFieldName == "loc") kwFieldName = "src"; // TODO: remove when .src is gone - } + //str fuid = getGetterNameForKwpField(adtType, kwFieldName); str getterName = unescapeAndStandardize("$getkw__"); if(getterName == "$getkw_Tree_message"){ // TODO: remove when annotations are gone diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalExpression.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalExpression.rsc index 1305424ad38..5d0992bfa06 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalExpression.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/RascalExpression.rsc @@ -1381,9 +1381,6 @@ MuExp translate (e:(Expression) ` [ @ = [ @ = @`) { tp = getType(expression); uname = unescape(""); - //if(asubtype(tp, treeType) && uname == "loc"){ //TODO: remove when loc anno has been removed - // uname = "src"; // rename loc to src - //} - //return muGetField(getType(e), tp, translate(expression), uname); + return muGetAnno(translate(expression), getType(e), uname); } diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/SrcTestCase.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/SrcTestCase.rsc new file mode 100644 index 00000000000..24070d6385b --- /dev/null +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/SrcTestCase.rsc @@ -0,0 +1,6 @@ +module lang::rascalcore::compile::Rascal2muRascal::SrcTestCase + +import lang::rascal::\syntax::Rascal; +loc translateAddFunction(Expression e){ + return e.lhs.src; +} diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/TypeUtils.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/TypeUtils.rsc index a89a045973b..52d87086da2 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/TypeUtils.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/Rascal2muRascal/TypeUtils.rsc @@ -607,9 +607,6 @@ tuple[str moduleName, AType atype, bool isKwp] getConstructorInfo(AType adtType, // Common kw field of concrete type? if(asubtype(adtType1, treeType)){ - //if(fieldName == "src"){ // TODO: remove when @\loc is gone - // return <"ParseTree", adtType1, true>; - //} for(Keyword kw <- adt_common_keyword_fields[treeType] ? []){ if("" == fieldName){ return ; diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/compile/muRascal2Java/CodeGen.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/compile/muRascal2Java/CodeGen.rsc index fdec9581eaa..c82d3a97aae 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/compile/muRascal2Java/CodeGen.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/compile/muRascal2Java/CodeGen.rsc @@ -900,7 +900,6 @@ JCode trans(muAssign(v:muTmpNative(str name, str fuid, NativeKind nkind), MuExp // muGetAnno JCode trans(muGetAnno(MuExp exp, AType resultType, str annoName), JGenie jg){ - if(annoName == "loc") annoName = "src";// TODO: remove when @\loc is gone return "$annotation_get(((INode)),\"\")"; } //TODO: the "_resultType" (instead of "resultType") is essential to @@ -908,7 +907,6 @@ JCode trans(muGetAnno(MuExp exp, AType resultType, str annoName), JGenie jg){ // muGuardedGetAnno JCode trans(muGuardedGetAnno(MuExp exp, AType _resultType, str annoName), JGenie jg){ - if(annoName == "loc") annoName = "src";// TODO: remove when @\loc is gone return "$guarded_annotation_get(((INode)),\"\")"; } @@ -1054,7 +1052,6 @@ str prefix(str moduleName, JGenie jg){ JCode trans(muGetKwField(AType resultType, adtType:aadt(_,_,_), MuExp cons, str fieldName, str moduleName), JGenie jg){ adtName = isEmpty(adtType.parameters) ? adtType.adtName : "_"; if(asubtype(adtType, treeType)){ - if(fieldName == "loc") fieldName = "src"; // TODO: remove when @\loc is gone adtName = "Tree"; } return "$getkw__()"; @@ -1063,7 +1060,6 @@ JCode trans(muGetKwField(AType resultType, adtType:aadt(_,_,_), MuExp cons, str JCode trans(muGetKwField(AType resultType, consType:acons(AType adt, list[AType] fields, list[Keyword] kwFields), MuExp cons, str fieldName, str moduleName), JGenie jg){ adtName = getUniqueADTName(adt); if(asubtype(adt, treeType)){ - if(fieldName == "loc") fieldName = "src"; // TODO: remove when @\loc is gone adtName = "Tree"; } isConsKwField = fieldName in {kwf.fieldType.alabel | kwf <- kwFields}; diff --git a/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java b/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java index 495a090ae6c..1cbca8745ae 100644 --- a/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java +++ b/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java @@ -697,10 +697,6 @@ public Type aliasType(String name, Type aliased, Type... parameters) { @Override public void declareAnnotation(Type onType, String label, Type valueType) { - // TODO: simulating annotations still here - if (RascalValueFactory.isLegacySourceLocationAnnotation(onType, label)) { - label = RascalValueFactory.Location; - } typeStore.declareKeywordParameter(onType, label, valueType); } diff --git a/src/org/rascalmpl/interpreter/result/ElementResult.java b/src/org/rascalmpl/interpreter/result/ElementResult.java index d4a6661ed87..3a9ed6635e2 100644 --- a/src/org/rascalmpl/interpreter/result/ElementResult.java +++ b/src/org/rascalmpl/interpreter/result/ElementResult.java @@ -24,8 +24,6 @@ import org.rascalmpl.interpreter.IEvaluatorContext; import org.rascalmpl.interpreter.env.Environment; import org.rascalmpl.interpreter.staticErrors.UnexpectedType; -import org.rascalmpl.values.RascalValueFactory; - import io.usethesource.vallang.IBool; import io.usethesource.vallang.IInteger; import io.usethesource.vallang.INode; @@ -153,14 +151,8 @@ public Result setAnnotation(String annoN // TODO: simulating annotations still here Type annoType; - if (RascalValueFactory.isLegacySourceLocationAnnotation(getStaticType(), annoName)) { - annoName = RascalValueFactory.Location; - annoType = getTypeFactory().sourceLocationType(); - } - else { - annoType = env.getKeywordParameterTypes(getStaticType()).get(annoName); - } - + annoType = env.getKeywordParameterTypes(getStaticType()).get(annoName); + if (getStaticType() != getTypeFactory().nodeType()) { if (!anno.getStaticType().isSubtypeOf(annoType)) { throw new UnexpectedType(annoType, anno.getStaticType(), ctx.getCurrentAST()); diff --git a/src/org/rascalmpl/library/List.rsc b/src/org/rascalmpl/library/List.rsc index 00abd9c5b26..92db179d35c 100644 --- a/src/org/rascalmpl/library/List.rsc +++ b/src/org/rascalmpl/library/List.rsc @@ -916,11 +916,11 @@ unzip2([<3,"thirty">, <1,"ten">, <4,"forty">]); unzip3([<3,"thirty",300>, <1,"ten",100>, <4,"forty",400>]); ``` } -tuple[list[&T],list[&U]] unzip2(list[tuple[&T,&U]] lst) = +tuple[list[&T],list[&U]] unzip2(lrel[&T,&U] lst) = <[t | <- lst], [u | <_,u> <- lst]>; // Make a triple of lists from a list of triples. -tuple[list[&T],list[&U],list[&V]] unzip3(list[tuple[&T,&U,&V]] lst) = +tuple[list[&T],list[&U],list[&V]] unzip3(lrel[&T,&U,&V] lst) = <[t | <- lst], [u | <_,u,_> <- lst], [w | <_,_,w> <- lst]>; @@ -938,9 +938,9 @@ upTill(10); java list[int] upTill(int n); -@synopsis{Make a list of pairs from two (three) lists of the same length.} +@synopsis{Make a list of pairs from two lists of the same length.} @description{ -Also see ((List-unzip3)). +Also see ((List-unzip2)). } @examples{ ```rascal-shell @@ -949,15 +949,61 @@ zip2([3, 1, 4], ["thirty", "ten", "forty"]); zip3([3, 1, 4], ["thirty", "ten", "forty"], [300, 100, 400]); ``` } -list[tuple[&T first, &U second]] zip2(list[&T] a, list[&U] b) { +lrel[&T first, &U second] zip2(list[&T] a, list[&U] b) { if(size(a) != size(b)) throw IllegalArgument(, "List size mismatch"); - return [ | i <- index(a)]; + return [ | i <- index(a)]; } -list[tuple[&T first, &U second, &V third]] zip3(list[&T] a, list[&U] b, list[&V] c) { +@synopsis{Make a list of pairs from two lists of possibly unequal length.} +lrel[&T first, &U second] zip2(list[&T] a, &T defA, list[&U] b, &U defB) { + tmpA = a + [defA | _ <- [0..max([0, size(b) - size(a)])]]; + tmpB = b + [defB | _ <- [0..max([0, size(a) - size(b)])]]; + + assert size(tmpA) == size(tmpB); + + return [ | i <- index(tmpA)]; +} + +@synopsis{Make a list of pairs: ``, where `i` is the index of the `e` element of a list.} +lrel[int index, &T elem] zipi(list[&T] a) { + int i = 0; + return for (&T e <- a) { + append ; + i += 1; + } +} + +@synopsis{Make a list of pairs: ``, where `i` is the index of the `e` element a set.} +@description{ +Useful for a countable iteration over a set. +Does not make an intermediate copy of the set, but iterates over the elements. +} +lrel[int index, &T elem] zipi(set[&T] a) { + int i = 0; + return for (&T e <- a) { + append ; + i += 1; + } +} + +@synopsis{Make a list of pairs from three lists of the same length.} +lrel[&T first, &U second, &V third] zip3(list[&T] a, list[&U] b, list[&V] c) { if(size(a) != size(b) || size(a) != size(c)) throw IllegalArgument(, "List size mismatch"); - return [ | i <- index(a)]; + return [ | i <- index(a)]; +} + +@synopsis{Make a list of pairs from three lists of possibly unequal length.} +lrel[&T first, &U second, &T third] zip3(list[&T] a, &T defA, list[&U] b, &U defB, list[&V] c, &V defC) { + longest = max([size(a), size(b), size(c)]); + + tmpA = a + [defA | _ <- [0..longest - size(a)]]; + tmpB = b + [defB | _ <- [0..longest - size(b)]]; + tmpC = c + [defC | _ <- [0..longest - size(c)]]; + + assert size(tmpA) == size(tmpB) && size(tmpB) == size(tmpC); + + return [ | i <- index(tmpA)]; } diff --git a/src/org/rascalmpl/semantics/dynamic/Declaration.java b/src/org/rascalmpl/semantics/dynamic/Declaration.java index c7879732aa0..03e64cad81f 100644 --- a/src/org/rascalmpl/semantics/dynamic/Declaration.java +++ b/src/org/rascalmpl/semantics/dynamic/Declaration.java @@ -60,6 +60,8 @@ public Annotation(ISourceLocation __param1, IConstructor tree, Tags __param2, Vi @Override public Result interpret(IEvaluator> __eval) { + __eval.warning("Annotations are deprecated. Use keyword fields instead.", src); + Type annoType = getAnnoType().typeOf(__eval.getCurrentEnvt(), __eval, false); String name = Names.name(this.getName()); diff --git a/src/org/rascalmpl/semantics/dynamic/Expression.java b/src/org/rascalmpl/semantics/dynamic/Expression.java index 158eae35550..2afdd104429 100644 --- a/src/org/rascalmpl/semantics/dynamic/Expression.java +++ b/src/org/rascalmpl/semantics/dynamic/Expression.java @@ -967,7 +967,7 @@ public IBooleanResult buildBacktracker(IEvaluatorContext __eval) { @Override public Result interpret(IEvaluator> __eval) { - + __eval.warning("Annotations are deprecated. Use keyword fields instead.", src); __eval.setCurrentAST(this); __eval.notifyAboutSuspension(this); @@ -983,10 +983,6 @@ public Result isDefined(IEvaluator> __eval) { Result lhs = getExpression().interpret(__eval); Name annoName = getName(); - if (lhs.getValue().getType().isSubtypeOf(RascalValueFactory.Tree) && "loc".equals(Names.name(annoName))) { - annoName = Names.toName("src", getName().getLocation()); - } - return lhs.isDefined(annoName); } } @@ -2500,7 +2496,7 @@ public IBooleanResult buildBacktracker(IEvaluatorContext __eval) { @Override public Result interpret(IEvaluator> __eval) { - + __eval.warning("Annotations are deprecated. Use keyword fields instead.", src); __eval.setCurrentAST(this); __eval.notifyAboutSuspension(this); diff --git a/src/org/rascalmpl/values/RascalValueFactory.java b/src/org/rascalmpl/values/RascalValueFactory.java index 8c61c614776..b10cad29d76 100644 --- a/src/org/rascalmpl/values/RascalValueFactory.java +++ b/src/org/rascalmpl/values/RascalValueFactory.java @@ -254,7 +254,6 @@ public class RascalValueFactory extends AbstractValueFactoryAdapter implements I public static final String Location = "src"; public static final String ParseError = "parseError"; - public static final String LegacyLocation = "loc"; static { uptr.declareKeywordParameter(Tree, Location, tf.sourceLocationType()); @@ -291,10 +290,6 @@ public RascalValueFactory() { public static TypeStore getStore() { return uptr; } - - public static boolean isLegacySourceLocationAnnotation(Type receiver, String label) { - return receiver.isSubtypeOf(Tree) && label.equals(LegacyLocation); - } /** * Allocates new {@link TypeStore} environments that are used within {@link IValueReader}.