c272 / iro4cli

An open-source rewrite of Iro, a grammar generator, supporting automatic VSCode & Atom extension generation.
GNU General Public License v3.0
35 stars 5 forks source link

`iro4cli` crashes on a seemingly correct grammar #9

Closed shrsv closed 1 year ago

shrsv commented 1 year ago

Hello @c272,

I have been working on an Iro grammar for my FOSS project.

It is a combination of JS, JSON and some custom syntax.

The definition works OK in Iro's web editor (screenshot below):

Selection_1011

However, when I run the same in iro4cli (after fixing various minor errors/warnings), I get the following Runtime unhandled exception:

[WARN] Compile - Some top-level flags are missing and/or not implemented yet.
Unhandled exception. System.NotImplementedException: The method or operation is not implemented.
   at iro4cli.Compile.Compiler.ProcessContext(String contextName, IroSet context, IroSet contexts)
   at iro4cli.Compile.Compiler.Compile(Dictionary`2 vars, ICompileTarget[] targets)
   at iro4cli.Program.Run(IroCLIOptions opts)
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at iro4cli.Program.Main(String[] args)
Aborted (core dumped)

Please find the grammar in the file: lama2.txt

Presently, I am able to get the generated outputs from the web-editor. However, it'll be really great to know your thoughts on why the particular grammar might be failing.

Thanks again, for your efforts :)

c272 commented 1 year ago

Hi @shrsv, thank you for bringing this to my attention. I've found the root cause of the issue and I'll push a patch for this in the next few days.

c272 commented 1 year ago

Hi @shrsv, I've just posted a pre-release version of a build that should fix this issue. If you could try it out and let me know if there are any remaining/new issues, that would be very helpful. Hope this helps!

https://github.com/c272/iro4cli/releases/tag/v0.4.1-rc1

shrsv commented 1 year ago

@c272 - Just tested it out; iro successfully generated Textmate plist from my grammar file. Looks like it's working. Thanks for the fix :)