This website works better with JavaScript.
Explore
Help
Register
Sign In
garrit
/
sabre
mirror of
https://git.sr.ht/~garritfra/sabre
Watch
1
Star
0
Fork
You've already forked sabre
0
Code
Issues
Projects
Releases
Activity
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
231
Commits
9
Branches
11
Tags
787 KiB
Tree:
2c6d81c063
assignment-operators
c_for-loops
clippy-fix
github-actions
llvm-integration
master
match-statements
modules
structs
v0.0.1
v0.0.2
v0.0.3
v0.0.4
v0.1.0
v0.1.1
v0.2.0
v0.2.1
v0.3.0
v0.4.0
v0.5.0
Branches
Tags
${ item.name }
Create tag
${ searchTerm }
Create branch
${ searchTerm }
from '2c6d81c063'
${ noResults }
sabre
/
tests
/
function_return_type_explic...
9 lines
116 B
Raw
Normal View
History
Unescape
Escape
tests: add e2e test cases
3 years ago
fn main() {
let x = add_one(2)
feat: struct definitions (#12) * feat: struct definitions * feat: struct initialization * chore: fix warning * feat: use `new` keyword to initialize structs * feat: infer struct type * feat: allow structs as types * feat: basic field access * chore: fix formatting * feat: assert function * docs: add structs * fix: builtin readme * chore: refactor field access parsing * chore: fix formatting * feat: struct field assignments * feat: struct field access in expressions * feat: struct field access on function calls * chore: fix formatting * feat: nested structs * chore: fix formatting * chore: fix clippy warnings Co-authored-by: Garrit Franke <garrit@slashdev.space>
3 years ago
assert(x == 3)
tests: add e2e test cases
3 years ago
println(x)
}
fn add_one(x: int): int {
return x + 1
}