rokucommunity / rokucommunity/brighterscript

many missing end ifs can cause the parser to get stuck forever

Open
#153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

I'll add an isolated file to this issue in due course; but for now, the following description explains the situation:
if you have a file with a certain quantity of if's without end ifs, then it really get's it's knickers in a twist
preprocess my unit tests to prefix the asserts with if not m.currentTest.isFail then m.assertFoo, so I have more resilience in tests when a prior assert crashes
and I started using the file resolver mechanism, which caused that regex to sometime slit the if then over 2 lines
so I had a lot of missing end ifs

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 unit tests and the file resolver mechanism described in the issue, then reproduce the parser hang using an isolated file once it is attached. Trace how multiline if statements are handled and verify that inputs with missing end ifs terminate without getting stuck.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.