Skip to content

Commit

Permalink
Function arguments test
Browse files Browse the repository at this point in the history
  • Loading branch information
Virgil Serbanuta authored and Virgil Serbanuta committed Aug 20, 2024
1 parent fb016fc commit 05255dd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SEMANTICS_FILES ::= $(shell find rust-semantics/ -type f -name '*')
SEMANTICS_FILES ::= $(shell find rust-semantics/ -type f -a '(' -name '*.md' -or -name '*.k' ')')
RUST_KOMPILED ::= .build/rust-kompiled
RUST_TIMESTAMP ::= $(RUST_KOMPILED)/timestamp
SYNTAX_INPUT_DIR ::= tests/syntax
Expand Down
4 changes: 3 additions & 1 deletion rust-semantics/preprocessing/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ module RUST-PREPROCESSING-PRIVATE-HELPERS
syntax NormalizedFunctionParameterOrError ::= normalizeParam(FunctionParam) [function, total]
rule normalizeParam(_:OuterAttributes Name:Identifier : T:Type) => Name : T
rule normalizeParam(P:FunctionParam) => error("unimplemented normalizedParam case", P:FunctionParam:KItem)
rule normalizeParam(P:FunctionParam)
=> error("unimplemented normalizedParam case", P:FunctionParam:KItem)
[owise]
syntax BlockExpressionOrSemicolon ::= getFunctionBlockOrSemicolon(Function) [function, total]
rule getFunctionBlockOrSemicolon(_Q:FunctionQualifiers F:FunctionWithoutQualifiers)
Expand Down
24 changes: 24 additions & 0 deletions tests/execution/function-arguments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#![no_std]

#[allow(unused_imports)]
use multiversx_sc::imports::*;

#[multiversx_sc::contract]
pub trait Empty {
#[init]
fn init(&self) {
}

#[upgrade]
fn upgrade(&self) {}

fn self_with_comma(&self, ) {}

fn self_and_arg(&self, first: BigUint) {}

fn self_and_args(&self, first: BigUint, second: BigUint) {}

fn self_and_args_comma(&self, first: BigUint, second: BigUint, ) {}

fn reference_arg(&self, first: &BigUint) {}
}

0 comments on commit 05255dd

Please sign in to comment.