Skip to content

Report missing statement semicolons at the closing token #361

Closed

Description

@LunaStev

Tracked by #346.

Problem

A missing semicolon inside a function is currently collapsed into a generic top-level function error:

fun main() {
    var value: i32 = 1
}

The parser has enough local context to report the missing ;, but that detail is printed ad hoc and discarded.

Scope

  • Return a structured syntax diagnostic when a declaration or expression statement requires a semicolon.
  • Point at the token that ends the incomplete statement, normally } or EOF.
  • Include ; in the expected-token list.
  • Cover explicit and inferred var declarations.
  • Add a valid statement control case.

Completion criteria

  • The message mentions the missing semicolon rather than the whole function declaration.
  • The source location is the incomplete statement boundary.
  • Human and JSON output agree.
  • The parser writes no duplicate error line to stdout.

Activity

  1. added
    enhancement
    good first issue
    on Aug 25, 2026
  2. added a commit that references this issue on Oct 22, 2026
    aef39a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions