float literal and identifier parsed incorrectly

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, rust
Domain
compilers

Research direction

Run the reported JavaScript inputs and compare the actual results with the expected syntax errors. Trace how the lexer or parser handles an integer immediately followed by an identifier, including the whitespace case, and consider the issue complete when all three examples produce the stated outputs.

Written by the indexing model from the issue text.

Description

A-parser bug

Inputs:

let x = 3; 3x
3 x
5y

Expected Outputs:

Syntax Error: Invalid or Unexpected token
Syntax Error: Unexpected identifier 'x'
Syntax Error: Invalid or Unexpected token

Actual Outputs:

3
3
ReferenceError: y is not defined

It seems that (integer)(identifier) is getting parsed as (integer), (identifier), effectively disposing the integer. None of these should pass the lexing stage, except in the case where there is whitespace between the two (both are valid tokens individually)

Dominant language
Rust
Stars
54
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from y21/dash

All issues in y21/dash

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.