Skip to content

[Bug] parse_natspec() bad tag parsing logic #595

@adraffy

Description

@adraffy

Encountered error:

error: invalid natspec tag '@5%', custom tags must use format '@custom:name'
   --> src/L2/registrar/StandardRentPriceOracle.sol:159:5
    |
159 |     ///        * Solve: 2yr @ 5% == 1yr @ 0% + 1yr @ x => x = 10.00%
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: script "coverage:forge" exited with code 1

Expected behavior:

Solve: 2yr @ 5% is not a tag.

Relevant parsing logic:
https://github.com/paradigmxyz/solar/blob/main/crates/parse/src/parser/mod.rs#L1089-L1090

Assuming anything following @ is a tag, independent of it's location, makes no sense.

Meta

forge Version: 1.3.1

Metadata

Metadata

Assignees

Labels

C-bugCategory: this is a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions