bug: .fizz file with no statements crashes the parser with a traceback
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start in parser/BuildAstVisitor.py, especially visitRoot, visitFile_input, and get_source_info, which appear in the traceback. Reproduce with the empty.fizz, zero-byte, newline-only, and front-matter-only inputs described in the issue, then trace how the parser represents an empty file. Done when these inputs compile without a Python traceback and a focused regression test covers the behavior.
Written by the indexing model from the issue text.
Description
fizzbee 0.5.4 from the tap, macos 26, arm64.
a .fizz file with no statements fails compilation with a python traceback.
$ printf '# todo\n' > empty.fizz
$ fizz empty.fizz
Traceback (most recent call last):
...
File ".../parser/BuildAstVisitor.py", line 29, in visitRoot
return self.visitFile_input(ctx.getChild(0))
File ".../parser/BuildAstVisitor.py", line 38, in visitFile_input
file = ast.File(source_info=get_source_info(ctx))
File ".../parser/BuildAstVisitor.py", line 1389, in get_source_info
start = ast.Position(line=ctx.start.line, column=ctx.start.column+1)
AttributeError: 'TerminalNodeImpl' object has no attribute 'start'
Error: Compilation failed
same result for a zero-byte file, a file with a single newline, and a file with only front matter. not tried on main.
- Dominant language
- Go
- Stars
- 361
- Forks
- 24
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 62
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fizzbee-io/fizzbee
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fizzbee-io/fizzbee#477 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
fizzbee-io/fizzbee#228 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fizzbee-io/fizzbee#441 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
fizzbee-io/fizzbee#438 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
fizzbee-io/fizzbee#432 ·
Maintainers usually reply within 1 day
All issues in fizzbee-io/fizzbee
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
wso2/api-platform#4369 ·
Maintainers usually reply within 1 day