XMLParser for jsp only works for jsp directives, but not for all jsp syntaxes
According to this link and other sources online, there are multiple tags possible in jsp.
It seems the parser is failing to handle different tags than the tested directive.
See unit test added as reference using 2 examples from provided link.
Caused by: org.openrewrite.xml.XmlParsingException: Syntax error in scriptlet.jsp at line 4:5 no viable alternative at input '<%'.
at org.openrewrite.xml.XmlParser$ForwardingErrorListener.syntaxError(XmlParser.java:120)
... 123 more
Caused by: org.antlr.v4.runtime.NoViableAltException
at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2031)
at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:470)
at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:396)
at org.openrewrite.xml.internal.grammar.XMLParser.element(XMLParser.java:1060
Added a test case that shows the failure.
Thanks! I think this might be similar to this issue right?
- https://github.com/openrewrite/rewrite/issues/4240
We added some basic JSP parser support in March via
- https://github.com/openrewrite/rewrite/pull/4075
Looks like we'd need to extend that to cover additional syntax.
Ah! Now I know where we get these loggings from! Most likely related indeed! Did not consider this one to be the same as it was talking about mod cli.
Sorry for the double!
found https://github.com/wjase/jsp-parser/tree/master/src/main/antlr4/com/cybernostics/jsp/parser which could be usefull for a bases for the antlr processing
found https://github.com/wjase/jsp-parser/tree/master/src/main/antlr4/com/cybernostics/jsp/parser which could be usefull for a bases for the antlr processing
Nice find! One of those times where "last changed 7 years ago" feels right, and not problematic. 😅 Are you exploring an extension to our Antlr spec then?
Well, if I can't sleep I will have a look at this. It's haunting me 😅
But feel free to assign someone if there is no progress here. Started several times already and rollend back. It's not a piece of cake
Here's a proposed extension to our XML handling to support more JSP elements:
- https://github.com/openrewrite/rewrite/pull/6054