Skip to content

Commit

Permalink
fix(parser): ignore more doc comments (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Nov 21, 2024
1 parent fc5d2d2 commit df50ff0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl<'sess, 'ast> Parser<'sess, 'ast> {
&mut self,
with: Option<Box<'ast, Expr<'ast>>>,
) -> PResult<'sess, Box<'ast, Expr<'ast>>> {
self.ignore_doc_comments();
let expr = self.parse_binary_expr(4, with)?;
if self.eat(&TokenKind::Question) {
let then = self.parse_expr()?;
Expand Down
28 changes: 28 additions & 0 deletions tests/ui/parser/unusual_doc_comments.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//@ compile-flags: --stop-after parsing

/// @dev func
function f(
/// @dev arg
uint x
) returns (
/// @dev ret
uint y
) {
/// @dev statement
SingleVaultSFData memory data = SingleVaultSFData(
/// a
LiqRequest(
_buildLiqBridgeTxData(
LiqBridgeTxDataArgs(
/// @dev placeholder value, not used
0
)
)
)
);

/// @dev msg sender is wallet, tx origin is deployer
SuperformRouter(payable(getContract(SOURCE_CHAIN, "SuperformRouter"))).singleXChainSingleVaultDeposit{
value: 2 ether
}(req);
}

0 comments on commit df50ff0

Please sign in to comment.