bijection / nearley-playground

⛹ Write Grammars for the Nearley Parser!
https://omrelli.ug/nearley-playground/
MIT License
83 stars 13 forks source link

Freezing #8

Closed HedvigS closed 6 years ago

HedvigS commented 7 years ago

Hi! I really like Nearley, and I was setting up some toy examples to teach others using the web browser playground app. But, it keeps freezing a lot. I fact, now it's freezing right away even with the most simple little grammars. What could be going on? The grammar is extremely simple in this case and it ran fine just moments ago. But now it does nothing but freeze, in chrome, in firefox, in private browsing.. yeah it just keeps freezing.

The script that is failing is: http://omrelli.ug/nearley-playground/dist/client.bundle.js:20

What could be up?

Here's an example of a grammar I've put in when it's been freezing

MIDSOMER_MURDERS_PLOT -> LOCAL PROFESSION FOUND DEAD PLACE SUSPICION SUSPECT ANGRY BLAMED THREAT THREATENED LOCAL -> "A local " PROFESSION -> "linguist" | "philosopher" | "novelist" FOUND -> " is found " DEAD -> "drowned" | "strangled" | "dead" | "tortured to death" | "hanged" | "battered" | "suffocated" | "shot" | "knifed" | "nuked" PLACE -> " in the coffee shop." |" in the swimming pool." | " after band practice."| " behind the primary school." SUSPICION -> " Suspicion falls on the village " SUSPECT -> "baker" | "pastor" | "mailman" | "florist" | "nerd" | "twins" ANGRY -> ", angry that the " BLAMED -> "new wind farm" | "pig" | "pub" | "decline in newspaper reading" | "metric system" THREAT -> " might threaten " THREATENED -> "the village fabric." | "what little sexual tension the village has left." | "the Old Inn." | "the cow farm."

It fails on line 20, but I don't know what the trouble is . I'm assuming copy-pasting in that bit of the script is not necessary (it's very large).

For some unknown reason, it now works in Chrome Incognito. I have done nothing different.

It can't select anything else but the first item for PROFESSION, so it's all linguists dying all the time (in this case). Unknown why, to me at least.

Output:

"A local linguist is found battered in the coffee shop. Suspicion falls on the village nerd, angry that the pub might threaten what little sexual tension the village has left."

“A local linguist is found shot after band practice. Suspicion falls on the village mailman, angry that the pub might threaten the Old Inn.”

"A local linguist is found dead after band practice. Suspicion falls on the village florist, angry that the decline in newspaper reading might threaten the village fabric.

bijection commented 7 years ago

Can you attach a screenshot of the error?

HedvigS commented 7 years ago

I'll screenshot it next time it happens. The error message is literally that script js:20 fails.

HedvigS commented 6 years ago

It's happening again :(. This time I've screenshotted it. It's chrome, and it won't generate. It won't react when I'm clicking "generate" at all.

nearleyscreen

bijection commented 6 years ago

Fixed in a7322d721e17a33a3003f989ee9af8c3992c36ae.