@@ -530,11 +530,11 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
530530 Token value = null ;
531531 Token attrType = null ;
532532 switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
533- case ALIGNRELN :
534533 case IDENTIFIER :{
534+ attr = jj_consume_token (IDENTIFIER );
535535 switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
536- case IDENTIFIER :{
537- attr = jj_consume_token ( IDENTIFIER );
536+ case 10 :
537+ case 22 :{
538538 switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
539539 case 10 :{
540540 attrType = jj_consume_token (10 );
@@ -563,6 +563,10 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
563563 jj_consume_token (-1 );
564564 throw new ParseException ();
565565 }
566+ if (attr != null && value != null ) {
567+ boolean negated = attrType .image .equals ("!:" );
568+ attributes .setAttribute (attr .image , value .image , negated );
569+ }
566570 break ;
567571 }
568572 case ALIGNRELN :{
@@ -583,23 +587,20 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
583587 jj_consume_token (-1 );
584588 throw new ParseException ();
585589 }
590+ if (attrType .image .equals ("@" )) {
591+ if (attr == null || key == null || value == null ) {
592+ {if (true ) throw new SemgrexParseException ("null while parsing semgrex expression: attr=" + attr +
593+ " key=" + key + " value=" + value );}
594+ }
595+ attributes .addContains (attr .image , key .image , value .image );
596+ }
586597 break ;
587598 }
588599 default :
589600 jj_la1 [26 ] = jj_gen ;
590601 jj_consume_token (-1 );
591602 throw new ParseException ();
592603 }
593- if (attrType .image .equals ("@" )) {
594- if (attr == null || key == null || value == null ) {
595- {if (true ) throw new SemgrexParseException ("null while parsing semgrex expression: attr=" + attr +
596- " key=" + key + " value=" + value );}
597- }
598- attributes .addContains (attr .image , key .image , value .image );
599- } else if (attr != null && value != null ) {
600- boolean negated = attrType .image .equals ("!:" );
601- attributes .setAttribute (attr .image , value .image , negated );
602- }
603604 break ;
604605 }
605606 case ROOT :{
@@ -625,7 +626,6 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
625626 NodePattern pat ;
626627 jj_consume_token (23 );
627628 switch ((jj_ntk ==-1 )?jj_ntk_f ():jj_ntk ) {
628- case ALIGNRELN :
629629 case IDENTIFIER :
630630 case EMPTY :
631631 case ROOT :{
@@ -690,7 +690,7 @@ final public SemgrexPattern Root() throws ParseException {// Root pattern for th
690690 jj_la1_init_0 ();
691691 }
692692 private static void jj_la1_init_0 () {
693- jj_la1_0 = new int [] {0x400 ,0x828808 ,0x3801c ,0x3801c ,0x828800 ,0x2000 ,0x3c01c ,0x4000 ,0x3801c ,0x2001c ,0x80000 ,0x10 ,0x110 ,0x110 ,0x100000 ,0x200000 ,0x1c ,0x828800 ,0x2000 ,0x82c000 ,0x4000 ,0x828000 ,0x820000 ,0x400400 ,0x110 ,0x110 ,0x18 , 0xd8 ,0x1000000 ,0xd8 ,0x200000 ,};
693+ jj_la1_0 = new int [] {0x400 ,0x828808 ,0x3801c ,0x3801c ,0x828800 ,0x2000 ,0x3c01c ,0x4000 ,0x3801c ,0x2001c ,0x80000 ,0x10 ,0x110 ,0x110 ,0x100000 ,0x200000 ,0x1c ,0x828800 ,0x2000 ,0x82c000 ,0x4000 ,0x828000 ,0x820000 ,0x400400 ,0x110 ,0x110 ,0x400408 , 0xd0 ,0x1000000 ,0xd0 ,0x200000 ,};
694694 }
695695
696696 /** Constructor with InputStream. */
0 commit comments