Inside some proc's there is this runnableExamples: what is this called? Is runnableExamples the only keyword for this type of code block, and is it always indented by four spaces? I'm trying to generate a parser for IntelliJ
runnableExamples:
let
a = [2, 3, 1, 5, 4]
b = sorted(a, system.cmp)
c = sorted(a, system.cmp, Descending)
doAssert b == @[1, 2, 3, 4, 5]
doAssert c == @[5, 4, 3, 2, 1]
More about the plugin: So far a lot of swearing, The PEG parser (I think it is? I don't know) makes no sense to me coming from ANTLR, I could practically copy and paste the grammer spec from the manual with ANTLR. Anyone have experience could give me a hand.
I've built my own plugins before that have added special inspections, tool windows, auto complete etc.
From a parsing perspective runnableExamples is nothing special. Your parser needs to be able to handle
mymacro:
bodyOfCodeHere