You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{if (true) thrownewSemgrexParseException("Use of & in semgrex patterns is now illegal. It is equivalent to the same expression without the &. Offending expression: " + startToken);}
101
-
}
102
-
if (deprecatedNodeConj) {
103
-
{if (true) thrownewSemgrexParseException("Use of node conjugation (expressions such as '< [foo bar]' or '< [foo & bar]') is now illegal. The issue is that expressions such as '[foo bar] < zzz' may intuitively mean that foo < zzz, bar < zzz, zzz the same for both cases, but that is not the way the parser interpreted this expression. Changing the functionality might break existing expressions, and anyway this can be rewritten in various ways such as 'zzz > foo > bar' or 'foo < zzz=a : bar < zzz=a'. Offending expression: " + startToken);}
{if (true) thrownewSemgrexParseException("Use of & in semgrex patterns is now illegal. It is equivalent to the same expression without the &. Offending expression: " + startToken);}
99
+
}
100
+
if (deprecatedNodeConj) {
101
+
{if (true) thrownewSemgrexParseException("Use of node conjugation (expressions such as '< [foo bar]' or '< [foo & bar]') is now illegal. The issue is that expressions such as '[foo bar] < zzz' may intuitively mean that foo < zzz, bar < zzz, zzz the same for both cases, but that is not the way the parser interpreted this expression. Changing the functionality might break existing expressions, and anyway this can be rewritten in various ways such as 'zzz > foo > bar' or 'foo < zzz=a : bar < zzz=a'. Offending expression: " + startToken);}
102
+
}
105
103
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
106
-
case12:{
107
-
jj_consume_token(12);
104
+
case11:{
105
+
jj_consume_token(11);
108
106
jj_consume_token(UNIQ);
109
107
uniqKeys = newArrayList<>();
110
108
label_2:
@@ -122,12 +120,20 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
122
120
nextIdentifier = identifier();
123
121
uniqKeys.add(nextIdentifier.image);
124
122
}
123
+
for (Stringkey : uniqKeys) {
124
+
if (!knownVariables.contains(key)) {
125
+
{if (true) thrownewSemgrexParseException("Semgrex pattern |" + startToken + "| asked for uniq of node " + key + " which does not exist in the pattern");}
126
+
}
127
+
}
128
+
// TODO: do shit here
129
+
125
130
break;
126
131
}
127
132
default:
128
133
jj_la1[3] = jj_gen;
129
134
;
130
135
}
136
+
jj_consume_token(12);
131
137
{if ("" != null) returnnode;}
132
138
thrownewError("Missing return statement in function");
133
139
}
@@ -573,11 +579,11 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
573
579
caseIDENTIFIER:{
574
580
attr = identifier();
575
581
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
576
-
case11:
582
+
case10:
577
583
case24:{
578
584
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
579
-
case11:{
580
-
attrType = jj_consume_token(11);
585
+
case10:{
586
+
attrType = jj_consume_token(10);
581
587
break;
582
588
}
583
589
case24:{
@@ -628,8 +634,8 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
628
634
thrownewParseException();
629
635
}
630
636
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
631
-
case11:{
632
-
attrType = jj_consume_token(11);
637
+
case10:{
638
+
attrType = jj_consume_token(10);
633
639
break;
634
640
}
635
641
case24:{
@@ -690,8 +696,8 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
690
696
thrownewParseException();
691
697
}
692
698
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
693
-
case11:{
694
-
attrType = jj_consume_token(11);
699
+
case10:{
700
+
attrType = jj_consume_token(10);
695
701
break;
696
702
}
697
703
case24:{
@@ -842,7 +848,7 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
node = new CoordinationPattern(true, children, true, true);
105
-
if (deprecatedAmp) {
106
-
throw new SemgrexParseException("Use of & in semgrex patterns is now illegal. It is equivalent to the same expression without the &. Offending expression: " + startToken);
107
-
}
108
-
if (deprecatedNodeConj) {
109
-
throw new SemgrexParseException("Use of node conjugation (expressions such as '< [foo bar]' or '< [foo & bar]') is now illegal. The issue is that expressions such as '[foo bar] < zzz' may intuitively mean that foo < zzz, bar < zzz, zzz the same for both cases, but that is not the way the parser interpreted this expression. Changing the functionality might break existing expressions, and anyway this can be rewritten in various ways such as 'zzz > foo > bar' or 'foo < zzz=a : bar < zzz=a'. Offending expression: " + startToken);
102
+
{
103
+
if (children.size() > 1)
104
+
node = new CoordinationPattern(true, children, true, true);
105
+
if (deprecatedAmp) {
106
+
throw new SemgrexParseException("Use of & in semgrex patterns is now illegal. It is equivalent to the same expression without the &. Offending expression: " + startToken);
107
+
}
108
+
if (deprecatedNodeConj) {
109
+
throw new SemgrexParseException("Use of node conjugation (expressions such as '< [foo bar]' or '< [foo & bar]') is now illegal. The issue is that expressions such as '[foo bar] < zzz' may intuitively mean that foo < zzz, bar < zzz, zzz the same for both cases, but that is not the way the parser interpreted this expression. Changing the functionality might break existing expressions, and anyway this can be rewritten in various ways such as 'zzz > foo > bar' or 'foo < zzz=a : bar < zzz=a'. Offending expression: " + startToken);
0 commit comments