guitarvydas / arith0d

0 stars 0 forks source link

Where is file `Arithmetic`? #3

Closed RAbraham closed 7 months ago

RAbraham commented 7 months ago

https://github.com/guitarvydas/arith0d/blob/main/main.odin#L19

components_to_include_in_project :: proc (leaves: ^[dynamic]zd.Leaf_Template) {
    zd.append_leaf (leaves, std.string_constant ("Arithmetic")) <---------------------------
    zd.append_leaf (leaves, std.string_constant ("arith.ohm"))

I see arith.ohm in the folder but not Arithmetic?

guitarvydas commented 7 months ago

The string "Arithmetic" is just a string, not a file, so you won't see it in the folder.

As it stands, the Transpile component needs to know the name of the grammar, which for this example is "Arithmetic".

"Transpile" is a low-level component that uses the most general form of OhmJS. This general form requires that the name of the grammar be explicitly provided. There is a form of OhmJS that doesn't need this name, but I'm not sure that it's worth the trouble to generalize this any further. The jury is out on this issue. If it makes sense to use the other form of OhmJS, I'll do it, but "Transpile" currently works the way it does and requires that the programmer supply a grammar name.