Commit 451e80f
committed
AXIS2-6095 Fix IDL parser fault on comments ending with **/
The ML_COMMENT lexer rule failed on Javadoc-style comments ending
with **/ (double asterisk before slash). The original rule's ('*')+
alternative consumed both asterisks, then the next char '/' didn't
match any inner alternative (which excluded both '*' and '/'),
causing a NoViableAltForCharException.
Fix: use a semantic predicate — consume '*' only when the next
character is not '/'. This ensures '*/' always terminates the
comment, regardless of how many asterisks precede it.
Both the ANTLR grammar (idl.g) and the generated lexer (IDLLexer.java)
are updated. The generated code is hand-edited to match since the
project uses ANTLR 2.7.6 which is no longer actively maintained.
Reported by Brănaci Șerban-Mihai.1 parent c833164 commit 451e80f
2 files changed
Lines changed: 12 additions & 41 deletions
Lines changed: 10 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
832 | 837 | | |
833 | 838 | | |
834 | 839 | | |
835 | 840 | | |
836 | | - | |
| 841 | + | |
837 | 842 | | |
838 | 843 | | |
839 | 844 | | |
840 | 845 | | |
841 | 846 | | |
842 | 847 | | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
| 848 | + | |
| 849 | + | |
873 | 850 | | |
874 | 851 | | |
875 | 852 | | |
876 | 853 | | |
877 | 854 | | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
| 855 | + | |
| 856 | + | |
882 | 857 | | |
883 | 858 | | |
884 | 859 | | |
885 | 860 | | |
886 | | - | |
887 | 861 | | |
888 | 862 | | |
889 | 863 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
| 1228 | + | |
| 1229 | + | |
1233 | 1230 | | |
1234 | 1231 | | |
1235 | 1232 | | |
| |||
0 commit comments