8char / laux-compiler

The LAU project by Metamist (Alexander Arvidsson) has long been dead. This fork aims to breathe new life into the project and continue its development with some updates to syntax and functionality.
MIT License
12 stars 1 forks source link

[Question] Why does the compiler parse a throw statement, if you can't use it ? #6

Open avivi55 opened 8 months ago

avivi55 commented 8 months ago

It is defined as a statement here : https://github.com/8char/laux-compiler/blob/40cd30669f79da5507fa5eee567686c084811405/src/definitions/statements.js#L196-L200

And it has a parsing function: https://github.com/8char/laux-compiler/blob/40cd30669f79da5507fa5eee567686c084811405/src/parser.js#L559-L577

But I can't see where it is used or how to use it, is it an old leftover from the fork ?

When I try to use it, it throws an invalid node type and not a SyntaxError

LAUX ERROR test.laux:
LAUX ERROR Error: Tried to print invalid node type 'ThrowStatement'

I was just wondering.

Thank you.

8char commented 8 months ago

This feature was meant to be implemented some time ago, but it was abandoned in that state. I'm currently working on completely rewriting the transpiler using TypeScript. This rewrite will enhance its testability and making it more user-friendly as a TypeScript/JavaScript library.

This feature will certainly be included in the rewrite. I appreciate you bringing it to my attention by making the issue, and I'll ensure that it'll be included in the revamped version of the transpiler.