Skip to content

Multiple let statements not supported #9

Description

@SAMBA8695

Bug Report: Only One Top-Level Statement Supported

Description

The compiler currently supports only a single top-level let statement.

After parsing one declaration, the parser stops and ignores any remaining input.

This prevents writing programs with more than one statement.

Example Input

let x = 1;
let y = x + 2;
let z = y + 3;

Only the first let statement is parsed and compiled.

Current Behavior

  • Parser handles only one top-level statement
  • Remaining tokens after the first statement are ignored
  • No program-level AST structure exists
  • Multiple declarations are not supported

Expected Behavior

  • The compiler should support multiple let statements
  • Statements should be parsed sequentially until TOKEN_END
  • A program should consist of a list of statements
  • Each statement should be processed in order

Suggested Direction

  • Introduce a program or statement-list AST node
  • Parse statements in a loop until TOKEN_END
  • Store statements in an array or linked list
  • Update IR generation to process all statements sequentially

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions