Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

No FIRRTL parsing error on malformed input #1154

Closed
seldridge opened this issue Aug 12, 2019 · 0 comments · Fixed by #1217
Closed

No FIRRTL parsing error on malformed input #1154

seldridge opened this issue Aug 12, 2019 · 0 comments · Fixed by #1217

Comments

@seldridge
Copy link
Member

The following malformed FIRRTL snippet parses just fine, but leads to a very unintuitive error later on. Here, a user forgets to indent a line in a module. This seems to kill parsing and you wind up with a likely downstream error of no top module being found.

circuit Foo:
  module Bar:
    input a: UInt<1>
output b: UInt<1>
    b <- a

  module Foo:
    input a: UInt<1>
    output b: UInt<1>
    inst bar of Bar
    bar.a <- a
    b <- bar.b
./utils/bin/firrtl -i Foo.fir
Exception in thread "main" firrtl.passes.CheckHighFormLike$NoTopModuleException: : A single module must be named Foo, but no modules have that name.
	at firrtl.passes.CheckHighFormLike.run(Checks.scala:235)
	at firrtl.passes.CheckHighFormLike.run$(Checks.scala:71)
	at firrtl.passes.CheckChirrtl.run(CheckChirrtl.scala:17)

Type of issue: bug report

If the current behavior is a bug, please provide the steps to reproduce the problem:

See example above.

  • Please tell us about your environment:
    master

What is the use case for changing the behavior?

Impact: no functional change

Development Phase: request

albert-magyar added a commit that referenced this issue Oct 29, 2019
* Fixes #1154
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540
albert-magyar added a commit that referenced this issue Oct 29, 2019
* Fixes #1154
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540
albert-magyar added a commit that referenced this issue Oct 29, 2019
* Fixes #1154
* Tests that #1154 example produces SyntaxErrorsException
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540
@mergify mergify bot closed this as completed in #1217 Nov 4, 2019
mergify bot pushed a commit that referenced this issue Nov 4, 2019
* Fixes #1154
* Tests that #1154 example produces SyntaxErrorsException
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540
mergify bot pushed a commit that referenced this issue Nov 22, 2019
* Fixes #1154
* Tests that #1154 example produces SyntaxErrorsException
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540

(cherry picked from commit 8f108c1)
mergify bot added a commit that referenced this issue Nov 22, 2019
* Fixes #1154
* Tests that #1154 example produces SyntaxErrorsException
* Generally helps catch trailing syntax errors
* Performance-neutral relative to previous grammar
* Recommended by antlr4 devs, can help performance in some cases
* See antlr/antlr4#1540

(cherry picked from commit 8f108c1)
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant