Missing parse rule havoc

I had this at the top of an oft-used tiddler…

\rules only commentblock commentinline filteredtranscludeinline transcludeinline macrodef macrocallinline

I’d long forgotten about that being there. Probably haven’t looked at it since it was added 300 years ago :wink:

But that’s actually the end of the story. It started when I modified this…

\define foo(...)
  stuff
\end

To this…

\procedure foo()
  Stuff
\end

and saved the tiddler.

:boom:
RSOE.

Devtools wrote thousands of lines to the console before I killed it.

The error, for those not following, a missing fnprocdef (and parameters, I guess) in the \rules pragma.

@jeremyruston Is this worth logging as a bug? I mean, it was hard to find that after a long edit session and trying to figure which change I’d made was likely to be causing the RSOE. Was wondering if there might be someway to catch that missing parse rule or, at least, surface the error better/differently…

hmm, That should not cause a problem.

For me it looks like this at tiddlywiki.com – So if you can reproduce it IMO it would be worth an issue at GH.

For those who want to know it. All the parsing rule names can be fount at: ControlPanel → Info → Advanced → Parsing

Agreed, hence the question.

Agreed again. However, I did so much hacking around trying to fix it, I’m not sure I can recreate the exact same conditions. And in all likelihood, the actual bang may have been due to something the parser hit way after the anomalous \procedure change.

Aside: At one point, I grabbed a recently saved bundle containing the same tiddler with the same macro prior to my big edit. I dug out the json code and created a single record json struct… somewhere in that process I lost a backslash…

[ 
  {
    "created": "20170429155102646",
    "text": "\rules only commentblock commentinline filteredtranscludeinline ... ",
    "title": "$:/.rgt/bk/macro/sectionview-macros",
    "modified": "20240125031535428",
    "tags": "$:/.rgt/bk/tag/bk-utility $:/tags/Macro edit-wide"
  }
]

Look at the "\rules... line – should be "\\rules.... That made a mess of the import (\r0D) which was intended to “fix” things. I think I’m going to blame the DuckDuckGo pretty print routine. :confused:

Anyway, thanks for looking, @pmario.