diff --git a/src/org/rascalmpl/values/parsetrees/ProductionAdapter.java b/src/org/rascalmpl/values/parsetrees/ProductionAdapter.java index 907ae429a9f..287e32002fb 100644 --- a/src/org/rascalmpl/values/parsetrees/ProductionAdapter.java +++ b/src/org/rascalmpl/values/parsetrees/ProductionAdapter.java @@ -158,11 +158,15 @@ public static boolean isKeyword(IConstructor tree) { } public static String getCategory(IConstructor tree) { + return getTagValue(tree, "category"); + } + + public static String getTagValue(IConstructor tree, String name) { if (!isRegular(tree)) { for (IValue attr : getAttributes(tree)) { if (attr.getType().isAbstractData() && ((IConstructor) attr).getConstructorType() == RascalValueFactory.Attr_Tag) { IValue value = ((IConstructor)attr).get("tag"); - if (value.getType().isNode() && ((INode) value).getName().equals("category")) { + if (value.getType().isNode() && ((INode) value).getName().equals(name)) { return ((IString) ((INode) value).get(0)).getValue(); } }