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:
parent
59970a4a45
commit
e16b765959
6 changed files with 67 additions and 2 deletions
|
|
@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue