lark-parser / lark-parser/Lark.js

Bug with `interactive.accepts()`

Open
#39 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
88
Forks
12
PR merge metrics
No merged PRs in 30d

Description

I believe there is a bug with the accepts() method when using interactive.

I set up a repo here demonstrating the issue.

This is the error:

Screenshot 2024-02-18 at 2 40 06 PM

I believe what is happening is that accepts is attempting to iterate with an of statement here, but it gets back an object from choices() which cannot be iterated over with of (it could be iterated over with in, which would return the object's keys).

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.

Research direction

Start with the generated json_parser.js references in the issue, especially choices() around line 2964 and accepts() around line 2975, then run the linked demo repository to reproduce the error. Done means interactive.accepts() handles the value returned by choices() without the reported iteration failure.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.