Hi, I tried Beauty with the php parser of
PHPParserPlugin and got this exception
[debug] BeautyThread: beautifying the buffer...
[error] BeautyThread: beauty.parsers.ParserException:
beauty.parsers.javacc.ParseException: Parse error at
line 6424, column 1. Encountered: /
[error] BeautyThread: at
beauty.beautifiers.JavaCCBeautifier.beautify(JavaCCBeautifier.java:38)
[error] BeautyThread: at
beauty.BeautyThread.run(BeautyThread.java:79)
[error] BeautyThread: at
org.gjt.sp.util.WorkThreadPool.addWorkRequest(WorkThreadPool.java:110)
[error] BeautyThread: at
org.gjt.sp.jedit.io.VFSManager.runInAWTThread(VFSManager.java:262)
[error] BeautyThread: at
beauty.BeautyPlugin.beautify(BeautyPlugin.java:54)
[error] BeautyThread: at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] BeautyThread: at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[error] BeautyThread: at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[error] BeautyThread: at
java.lang.reflect.Method.invoke(Unknown Source)
[error] BeautyThread: at
bsh.Reflect.invokeOnMethod(Reflect.java:148)
[error] BeautyThread: at
bsh.Reflect.invokeStaticMethod(Reflect.java:99)
[error] BeautyThread: at
bsh.Name.invokeMethod(Name.java:872)
[error] BeautyThread: at
bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:72)
[error] BeautyThread: at
bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
[error] BeautyThread: at
bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
[error] BeautyThread: at
bsh.BSHBlock.evalBlock(BSHBlock.java:130)
[error] BeautyThread: at
bsh.BSHBlock.eval(BSHBlock.java:80)
[error] BeautyThread: at
bsh.BshMethod.invokeImpl(BshMethod.java:349)
[error] BeautyThread: at
bsh.BshMethod.invoke(BshMethod.java:246)
[error] BeautyThread: at
bsh.BshMethod.invoke(BshMethod.java:171)
[error] BeautyThread: at
org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:507)
[error] BeautyThread: at
org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:76)
[error] BeautyThread: at
org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:229)
[error] BeautyThread: at
org.gjt.sp.jedit.jEdit$3.invokeAction(jEdit.java:2902)
[error] BeautyThread: at
org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditAction.java:215)
[error] BeautyThread: at
javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
[error] BeautyThread: at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
[error] BeautyThread: at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
[error] BeautyThread: at
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
[error] BeautyThread: at
javax.swing.AbstractButton.doClick(Unknown Source)
[error] BeautyThread: at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown
Source)
[error] BeautyThread: at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
[error] BeautyThread: at
java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
[error] BeautyThread: at
java.awt.Component.processMouseEvent(Unknown Source)
[error] BeautyThread: at
javax.swing.JComponent.processMouseEvent(Unknown Source)
[error] BeautyThread: at
java.awt.Component.processEvent(Unknown Source)
[error] BeautyThread: at
java.awt.Container.processEvent(Unknown Source)
[error] BeautyThread: at
java.awt.Component.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Container.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Component.dispatchEvent(Unknown Source)
[error] BeautyThread: at
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
[error] BeautyThread: at
java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
[error] BeautyThread: at
java.awt.LightweightDispatcher.dispatchEvent(Unknown
Source)
[error] BeautyThread: at
java.awt.Container.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Window.dispatchEventImpl(Unknown Source)
[error] BeautyThread: at
java.awt.Component.dispatchEvent(Unknown Source)
[error] BeautyThread: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[error] BeautyThread: at
java.awt.EventDispatchThread.run(Unknown Source)
[error] BeautyThread: Caused by:
beauty.parsers.javacc.ParseException: Parse error at
line 6424, column 1. Encountered: /
[error] BeautyThread: at
beauty.parsers.javacc.JavaCCParser.generateParseException(JavaCCParser.java:7927)
[error] BeautyThread: at
beauty.parsers.javacc.JavaCCParser.jj_consume_token(JavaCCParser.java:7879)
[error] BeautyThread: at
beauty.parsers.javacc.JavaCCParser.javacc_input(JavaCCParser.java:148)
[error] BeautyThread: at
beauty.beautifiers.JavaCCBeautifier.beautify(JavaCCBeautifier.java:29)
[error] BeautyThread: ... 51 more
I tried also it with php but it put everything in one
line ...
Logged In: YES
user_id=187628
I don't know what this means:
"I tried Beauty with the php parser of PHPParserPlugin "
The bug title references JavaCC. So is the problem
happening when you're trying to format a javacc file or a
php file? What does the PHPParserPlugin have to do with it?
Do you have the Beauty options set so that PHP is
formatted with the html beautifier and javacc files are
formatted with the javacc beautifier? I don't know much
about PHP, so a little more guidance would be helpful.
Would you attach a PHP file to this bug?
Thanks,
Dale
Logged In: YES
user_id=285591
Hi, I meant I tried to use the plugin with the php parser I
use in PHPParserPlugin (it's javaCC parser) :
PHPParser.jj
http://cvs.sourceforge.net/viewcvs.py/jedit/plugins/PHPParser/src/gatchan/phpparser/parser/PHPParser.jj?rev=1.77&view=log
Logged In: YES
user_id=187628
Ah! That makes sense. Note the 0.1 version number for Beauty
-- it really hasn't had a lot of testing on a wide variety
of files yet. My main motivators were I wanted a beautifier
for jsp files and javacc files. The html/jsp beautifying
seems to work really well, the java and javacc are still a
bit rough. I'll use your PHPParser.jj file as a test file.
Logged In: YES
user_id=187628
Fix had been checked into jEdit CVS. The problem is the
PHPParser.jj file has a single line comment at the very end
of the file without a trailing line separator, which was not
allowed by the javacc grammar. I've adjusted the grammar to
support this situation. A short term work around (until the
next plugin release) would be to add a line separator after
the last comment.
Logged In: YES
user_id=285591
Hi, I compiled it and it seems fixed here too but I have
another bug, not sure if it's a bug of your plugin or a
jEdit bug you can see if you want
https://sourceforge.net/tracker/index.php?func=detail&aid=1476152&group_id=588&atid=100588