ohmjs / ohm

A library and language for building parsers, interpreters, compilers, etc.
MIT License
5.01k stars 217 forks source link

Typescript example fails to compile #474

Open evilguest opened 7 months ago

evilguest commented 7 months ago

I have checked out the ohm repository. Now I'm trying to run the tests in the examples/typescript folder, but it does fail with the following diagnostics:

TSError: ⨯ Unable to compile TypeScript:
src/arithmetic.ts:10:44 - error TS2307: Cannot find module './arithmetic.ohm-bundle' or its corresponding type declarations.

The ohm generateBundles --withTypes 'src/*.ohm' command did complete with no output to console; however, I am not seeing any results (.ts/d.ts files) in the folder.

What am I doing wrong?

kamtschatka commented 6 months ago

I ran into a similar issue, maybe you have a problem with the ' around the path? The sample in the doc does not work for me. I have to call npx ohm generateBundles --withTypes src/*.ohm

Additionally it does not work with windows style path separators: npx ohm generateBundles --withTypes .\src\*.ohm does not work (tried all kinds of combinations without the leading . and so on as well)