Fix the bug of mapping ast node types.
This commit is contained in:
@@ -83,11 +83,16 @@ public class HierarchicalRegrouper {
|
|||||||
int index = actStrFrag.lastIndexOf(" ") + 1;
|
int index = actStrFrag.lastIndexOf(" ") + 1;
|
||||||
String nodeType = actStrFrag.substring(index);
|
String nodeType = actStrFrag.substring(index);
|
||||||
if (!"".equals(nodeType)) {
|
if (!"".equals(nodeType)) {
|
||||||
try {
|
if (Character.isDigit(nodeType.charAt(0)) || nodeType.startsWith("-")) {
|
||||||
String type = ASTNodeMap.map.get(Integer.parseInt(nodeType));
|
try {
|
||||||
nodeType = type;
|
int typeInt = Integer.parseInt(nodeType);
|
||||||
} catch (NumberFormatException e) {
|
if (ASTNodeMap.map.containsKey(typeInt)) {
|
||||||
// nodeType = actStrFrag.substring(index);
|
String type = ASTNodeMap.map.get(Integer.parseInt(nodeType));
|
||||||
|
nodeType = type;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
nodeType = actStrFrag.substring(index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actStrFrag = actStrFrag.substring(0, index) + nodeType + "@@";
|
actStrFrag = actStrFrag.substring(0, index) + nodeType + "@@";
|
||||||
|
|||||||
Reference in New Issue
Block a user