github / github/codeql

Ruby: Error parsing embedded multiline blocks

Open
#19,841 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

**Description of the issue**

Seeing this error in the CodeQL run: `A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.`

The errored code block in question looks something like this and runs correctly.

```ruby
<<~BLOCKA
if some_condition?
<<~BLOCKB
BLOCKB
end
BLOCKA
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the CodeQL parsing error with the embedded Ruby example in the issue, focusing on nested multiline blocks. Trace the Ruby parser handling of the heredoc-like syntax; done means valid code with this structure parses without the reported error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.