antlr / antlr4-lab

A client/server for trying out and learning about ANTLR
MIT License
36 stars 11 forks source link

Input text box is being ignored in the latest online website! #41

Closed kaby76 closed 1 year ago

kaby76 commented 1 year ago

Go to lab.antlr.org and do the following:

Go to http://134.209.209.215/ and repeat the steps. It works correctly. This is my website with my original code before the latest changes.

The input text box looks correct but the parser input is something else!

kaby76 commented 1 year ago

I traced it down to this code, which returns 1, but the code just ignores the result, trying to just continue.

Manually typing the pdfcrop command:

root@ubuntu-s-1vcpu-512mb-10gb-nyc1-01:/tmp/antlr-images# pdfcrop --hires temp.pdf
PDFCROP 1.40, 2020/06/06 - Copyright (c) 2002-2020 by Heiko Oberdiek, Oberdiek Package Support Group.
!!! Error: pdfTeX run failed with value 1!

The temp.ps file looks fine, and temp.pdf also looks correct. The result of the command creates a zero-lengthed "tmp-pdfcrop-NNNN.pdf" file.

I never quite understood why you call pdfcrop. That is why I removed the step because I don't think it's necessary. After removing the step, I just did "pdf2svg" of temp.pdf directly, and it produces fine svg's.

After it fails, the stale, left over temp.svg that was done by some--any--client is just returned. It should really nuke the file after sending the result back to the client.

parrt commented 1 year ago

hmm...works for me on C. let me try java. wow. weird. it's the crop? i did that to avoid padding to a full page I think.

parrt commented 1 year ago

oh. already have issue: https://github.com/antlr/antlr4-lab/issues/38

parrt commented 1 year ago

Just gotta add thread ID to filename.

parrt commented 1 year ago

Just pushed a fix. It appears to work. thanks, Ken!

kaby76 commented 1 year ago

Yes, that works a lot better!