(LoadContext context, String first)
| 104 | } |
| 105 | |
| 106 | @Nullable |
| 107 | public static PersistentTransitionChoice<?> processOldAdd(LoadContext context, String first) |
| 108 | { |
| 109 | int openParenLoc = first.indexOf('('); |
| 110 | if (openParenLoc == -1) |
| 111 | { |
| 112 | Logging.errorPrint("Expected to have a ( : " + first); |
| 113 | return null; |
| 114 | } |
| 115 | int closeParenLoc = first.lastIndexOf(')'); |
| 116 | if (closeParenLoc == -1) |
| 117 | { |
| 118 | Logging.errorPrint("Expected to have a ) : " + first); |
| 119 | return null; |
| 120 | } |
| 121 | String key = first.substring(7, openParenLoc); |
| 122 | String choices = first.substring(openParenLoc + 1, closeParenLoc); |
| 123 | String count = ""; |
| 124 | if (closeParenLoc != (first.length() - 1)) |
| 125 | { |
| 126 | count = first.substring(closeParenLoc + 1) + '|'; |
| 127 | } |
| 128 | PCClass applied = new PCClass(); |
| 129 | ParseResult pr = context.processSubToken(applied, "ADD", key, count + choices); |
| 130 | pr.printMessages(context.getSourceURI()); |
| 131 | if (!pr.passed()) |
| 132 | { |
| 133 | return null; |
| 134 | } |
| 135 | context.commit(); |
| 136 | return applied.getListFor(ListKey.ADD).get(0); |
| 137 | } |
| 138 | |
| 139 | } |
no test coverage detected