1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-19 07:05:58 +00:00

Parser: audio statements (play / start_music / stop_music)

The \`play\`, \`start_music\`, and \`stop_music\` keywords were lexed
but not parsed. Programs using them failed with a generic "unexpected
token" error. Now:

- \`Statement::Play(sfx_name, span)\`
- \`Statement::StartMusic(track_name, span)\`
- \`Statement::StopMusic(span)\`

parse successfully and flow through analyzer / IR lowering / codegen
as no-ops. Semantics match the spec but produce no output — no audio
driver exists yet. Users who need sound can still wire in custom
code via \`asm { ... }\` blocks.

https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
This commit is contained in:
Claude 2026-04-12 16:38:59 +00:00
parent 59970a4a45
commit e16b765959
No known key found for this signature in database
6 changed files with 67 additions and 2 deletions

View file

@ -344,6 +344,10 @@ impl LoweringContext {
Statement::InlineAsm(body, _) => {
self.emit(IrOp::InlineAsm(body.clone()));
}
Statement::Play(_, _) | Statement::StartMusic(_, _) | Statement::StopMusic(_) => {
// No audio driver yet — these parse but produce no
// IR.
}
}
}