atsushieno / mugene-ng

Music Macro Language to MIDI 1.0 / 2.0 compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiler should not crash with stack trace for simple syntax error

atsushieno opened this issue · comments

Currently if we compile MML like this simple (note that - is at wrong place):

1 e0g0-b4.

It results in:

Exception in thread "main" dev.atsushieno.mugene.MmlException: (unknown) (152, 40) : error: no viable alternative at input '0.0'
	at dev.atsushieno.mugene.MmlCompiler.reportOnConsole(mml_compiler_main.kt:70)
	at dev.atsushieno.mugene.MmlCompiler.access$reportOnConsole(mml_compiler_main.kt:41)
	...

But that's absurd. It should report simple syntax error instead.

Now we do not crash like ^ anymore:

(unknown) (1, 7) : error: no viable alternative at input '0.0'