|
5 | 5 | import lombok.val;
|
6 | 6 | import twg2.arrays.ArrayUtil;
|
7 | 7 | import twg2.parser.codeParser.CodeFragmentType;
|
| 8 | +import twg2.parser.documentParser.CodeFragment; |
8 | 9 | import twg2.parser.documentParser.DocumentFragment;
|
9 |
| -import twg2.parser.documentParser.DocumentFragmentText; |
10 | 10 | import twg2.treeLike.simpleTree.SimpleTree;
|
11 | 11 |
|
12 | 12 | /**
|
@@ -53,33 +53,33 @@ public static final boolean isType(DocumentFragment<?, CodeFragmentType> node, C
|
53 | 53 | }
|
54 | 54 |
|
55 | 55 |
|
56 |
| - public static final boolean isOptionalTypeMarker(DocumentFragmentText<CodeFragmentType> node) { |
| 56 | + public static final boolean isOptionalTypeMarker(CodeFragment node) { |
57 | 57 | return node != null && (node.getFragmentType() == CodeFragmentType.OPERATOR && "?".equals(node.getText()));
|
58 | 58 | }
|
59 | 59 |
|
60 | 60 |
|
61 |
| - public static final boolean isIdentifier(DocumentFragmentText<CodeFragmentType> node) { |
| 61 | + public static final boolean isIdentifier(CodeFragment node) { |
62 | 62 | return node != null && (node.getFragmentType() == CodeFragmentType.IDENTIFIER);
|
63 | 63 | }
|
64 | 64 |
|
65 | 65 |
|
66 |
| - public static final boolean isIdentifierOrKeyword(DocumentFragmentText<CodeFragmentType> node) { |
| 66 | + public static final boolean isIdentifierOrKeyword(CodeFragment node) { |
67 | 67 | return node != null && (node.getFragmentType() == CodeFragmentType.KEYWORD || node.getFragmentType() == CodeFragmentType.IDENTIFIER);
|
68 | 68 | }
|
69 | 69 |
|
70 | 70 |
|
71 |
| - public static final boolean isKeyword(DocumentFragmentText<CodeFragmentType> node) { |
| 71 | + public static final boolean isKeyword(CodeFragment node) { |
72 | 72 | return node != null && (node.getFragmentType() == CodeFragmentType.KEYWORD);
|
73 | 73 | }
|
74 | 74 |
|
75 | 75 |
|
76 |
| - public static final boolean isBlock(DocumentFragmentText<CodeFragmentType> node, String blockSymbol) { |
| 76 | + public static final boolean isBlock(CodeFragment node, String blockSymbol) { |
77 | 77 | return node != null && node.getFragmentType().isCompound() && node.getText().startsWith(blockSymbol);
|
78 | 78 | }
|
79 | 79 |
|
80 | 80 |
|
81 | 81 | // TODO unused
|
82 |
| - public static final boolean blockContainsOnly(SimpleTree<DocumentFragmentText<CodeFragmentType>> block, BiPredicate<DocumentFragmentText<CodeFragmentType>, CodeFragmentType> cond, boolean emptyTreeValid, CodeFragmentType... optionalAllows) { |
| 82 | + public static final boolean blockContainsOnly(SimpleTree<CodeFragment> block, BiPredicate<CodeFragment, CodeFragmentType> cond, boolean emptyTreeValid, CodeFragmentType... optionalAllows) { |
83 | 83 | if(block == null) {
|
84 | 84 | return emptyTreeValid;
|
85 | 85 | }
|
|
0 commit comments