Skip to content

Reject unexpected top-level assembler tokens instead of discarding them #29

Closed

Description

@LunaStev

Current evidence

Audit baseline: master 3ac33ec1, after #11. Source: assembler/src/isa/amd64/parser.rs:51.

Reproduced: a standalone ] followed by nop succeeds because the top-level parser skips any non-identifier/non-newline token.

Reproduction

On Linux x86_64 (Rust 1.96.0), save as repro.asm:

section .text
]
nop

Run cargo run -- asm --amd64 repro.asm -o repro.o.

Observed exit status: 0.

Wrote 456 bytes to repro.o

Scope

Difficulty: easy.

Report unexpected punctuation and numeric tokens at top level while retaining valid labels and blank lines.

Completion criteria

  • Standalone ], , and numeric tokens fail with line/column information.
  • Labels on instruction lines and empty/comment lines still work.
  • Tests assert that malformed input cannot emit an object.

Backlog index: #12. This issue owns only the bounded work described above.

Activity

  1. added
    bug
    good first issue
    assembler
    needs testing
    priority medium
    on Sep 18, 2026
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

    assemblerbuggood first issueneeds testingpriority medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions