Skip to content

Commit

Permalink
chore: fix body expr span (#2402)
Browse files Browse the repository at this point in the history
  • Loading branch information
kek kek kek authored Aug 22, 2023
1 parent 179611b commit 2fbcb45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/noirc_frontend/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ fn function_definition(allow_self: bool) -> impl NoirParser<NoirFunction> {
.then(parenthesized(function_parameters(allow_self)))
.then(function_return_type())
.then(where_clause())
.then(block(expression()))
.validate(|(((args, ret), where_clause), body), span, emit| {
.then(spanned(block(expression())))
.validate(|(((args, ret), where_clause), (body, body_span)), span, emit| {
let ((((attribute, modifiers), name), generics), parameters) = args;
validate_where_clause(&generics, &where_clause, span, emit);
FunctionDefinition {
span: name.0.span(),
span: body_span,
name,
attribute, // XXX: Currently we only have one attribute defined. If more attributes are needed per function, we can make this a vector and make attribute definition more expressive
is_unconstrained: modifiers.0,
Expand Down

0 comments on commit 2fbcb45

Please sign in to comment.