mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 08:55:38 +00:00
Parser: E0505 error on multiple 'start' declarations
Previously a second \`start X\` statement silently overrode the first. Now emits E0505 at parse time. https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
This commit is contained in:
parent
814cbe54bd
commit
4e05c008ce
3 changed files with 24 additions and 1 deletions
|
|
@ -163,8 +163,16 @@ impl Parser {
|
|||
on_frame = Some(self.parse_on_frame()?);
|
||||
}
|
||||
TokenKind::KwStart => {
|
||||
let kw_span = self.current_span();
|
||||
self.advance();
|
||||
let (name, _) = self.expect_ident()?;
|
||||
if start_state.is_some() {
|
||||
return Err(Diagnostic::error(
|
||||
ErrorCode::E0505,
|
||||
"multiple 'start' declarations",
|
||||
kw_span,
|
||||
));
|
||||
}
|
||||
start_state = Some(name);
|
||||
}
|
||||
_ => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue