Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ameliatastic/seahorse-lang
/ functions
Functions
580 in github.com/ameliatastic/seahorse-lang
⨍
Functions
580
◇
Types & classes
238
↓ 289 callers
Method
clone
(&self)
tests/compiled-examples/pyth.rs:78
↓ 147 callers
Method
map
Map every leaf element with a function, consuming this tree and returning a new one with the same structure.
src/core/util.rs:167
↓ 69 callers
Method
push
(&mut self, part: String)
src/core/preprocess/mod.rs:175
↓ 52 callers
Function
ident
Convenience function for turning strings into Idents
src/core/generate/mod.rs:34
↓ 52 callers
Method
unify
Unify types. A normal unification algorithm will just make two types the same. Seahorse needs to keep a line between what the user can do and compile
src/core/compile/check/mod.rs:2055
↓ 44 callers
Method
insert
Insert a subtree into the tree at the given path. Returns whether the operation completed successfully - will fail if the insertion would have to ove
src/core/util.rs:286
↓ 39 callers
Method
check_expr
Typecheck an expression that needs to unify to type `expr_ty`. Based on the expression, might impose additional constraints on the underlying type of
src/core/compile/check/mod.rs:1234
↓ 37 callers
Method
try_into
(self)
src/core/clean/mod.rs:219
↓ 36 callers
Method
get
Get a reference to a node in the tree at the given `path`.
src/core/util.rs:229
↓ 35 callers
Method
clone
(&self)
tests/compiled-examples/stored_mutables.rs:490
↓ 29 callers
Method
free
Add a new free variable, returning the new type parameter.
src/core/compile/check/mod.rs:593
↓ 28 callers
Method
core
(self, loc: &Location)
src/core/compile/check/mod.rs:49
↓ 18 callers
Method
located
(self, loc: Location)
src/core/util.rs:28
↓ 17 callers
Method
index
(&self)
src/core/compile/builtin/mod.rs:81
↓ 16 callers
Method
pop
(&mut self)
src/core/preprocess/mod.rs:179
↓ 13 callers
Function
error_message
Generic error message formatting.
src/bin/cli/util.rs:27
↓ 12 callers
Method
core
(self, loc: &Location)
src/core/compile/sign/mod.rs:35
↓ 12 callers
Method
core
(self, loc: Location)
src/core/clean/mod.rs:51
↓ 12 callers
Method
key
Get this account's key.
data/const/seahorse_prelude.py:914
↓ 10 callers
Method
clone
(&self)
tests/compiled-examples/calculator.rs:174
↓ 10 callers
Method
clone
(&self)
tests/compiled-examples/hello.rs:128
↓ 10 callers
Method
core
(self)
src/core/compile/namespace/mod.rs:23
↓ 10 callers
Method
optional
Get the result of an optional argument - if it's a placeholder, return `None`.
src/core/compile/ast.rs:296
↓ 10 callers
Method
transpose
Turns a Tree<Result<T, E>> into a Result<Tree<T>, Vec<E>>. Only one error is returned. Multiple may have been generated, but whichever one is reached
src/core/util.rs:383
↓ 9 callers
Method
clone
(&self)
tests/compiled-examples/fizzbuzz.rs:124
↓ 9 callers
Function
declare_id
Inform Anchor what this program's ID is. @param id: The program's ID, generated by Anchor in /target/idl/<program>.json. This must be copied-past
data/const/seahorse_prelude.py:1036
↓ 9 callers
Method
finalize
Make a parameterized type into a finalized type, if possible.
src/core/compile/check/mod.rs:668
↓ 9 callers
Method
without_borrows
Remove the borrows from this expression.
src/core/compile/ast.rs:313
↓ 8 callers
Method
get_leaf
Get a reference to a leaf in the tree at the given `path`.
src/core/util.rs:252
↓ 6 callers
Method
base
Get the base type of a type parameter (recursively).
src/core/compile/check/mod.rs:607
↓ 6 callers
Method
clone
(&self)
tests/compiled-examples/event.rs:115
↓ 6 callers
Method
constructor
(&self, name: TyName)
src/core/compile/sign/mod.rs:127
↓ 6 callers
Method
core
(&self)
src/core/preprocess/mod.rs:28
↓ 6 callers
Method
get_leaf_ext
Get the "leaf of a leaf" from a tree.
src/core/util.rs:427
↓ 6 callers
Method
init
Initialize the account. @param payer: The account that will pay for the rent cost of the initialized account. Must be an ins
data/const/seahorse_prelude.py:892
↓ 6 callers
Method
with_loc
(self, loc: SrcLocation)
src/core/util.rs:44
↓ 6 callers
Method
zip
(self, tree: Tree<U>)
src/core/util.rs:213
↓ 5 callers
Method
build_ty
(&self, ty_expr: &ca::TyExpression, abs: &Vec<String>)
src/core/compile/namespace/mod.rs:233
↓ 5 callers
Method
check_block
Typecheck a block of statements. Includes an optional parameter for passing in a pre-made scope.
src/core/compile/check/mod.rs:1073
↓ 5 callers
Method
clone
(&self)
tests/compiled-test-cases/account_key.rs:133
↓ 5 callers
Method
get_path
Get the "full" path (base + path).
src/core/preprocess/mod.rs:148
↓ 5 callers
Method
is_copy
Returns whether this type is Rust-`Copy`.
src/core/compile/check/mod.rs:221
↓ 5 callers
Method
new_ty
Add a new type, returning the associated parameter.
src/core/compile/check/mod.rs:600
↓ 5 callers
Method
remove
Remove the subtree at the given `path`. Returns the removed subtree, if one exists.
src/core/util.rs:336
↓ 5 callers
Function
with_spinner
Run a task with a terminal spinner, with a custom success message.
src/bin/cli/util.rs:6
↓ 4 callers
Method
add_module
Add a module.
src/core/preprocess/mod.rs:217
↓ 4 callers
Function
as_assignment_target
Optionally convert an expression into targets for variable assignment.
src/core/compile/check/mod.rs:424
↓ 4 callers
Method
base_ty
(&self, ty: Ty)
src/core/compile/check/mod.rs:2039
↓ 4 callers
Function
build_function_signature
( params: &ca::Params, returns: &Option<ca::TyExpression>, abs: &Vec<String>, root: &Tree<Name
src/core/compile/sign/mod.rs:495
↓ 4 callers
Method
declare_target
Declare a target, creating a new type parameter for it. Also builds a list of the variable names that get declared by this target. Declarations can h
src/core/compile/check/mod.rs:729
↓ 4 callers
Method
defined_attr
(&mut self, path: &Vec<String>, attr: &String)
src/core/compile/check/mod.rs:966
↓ 4 callers
Method
get_fs_module_path
Get the filesystem path for a module at this path
src/core/preprocess/mod.rs:155
↓ 4 callers
Method
get_mut
Get a mutable reference to a node in the tree at the given `path`.
src/core/util.rs:260
↓ 4 callers
Function
namespace
Builds the namespace of every module.
src/core/compile/namespace/mod.rs:512
↓ 4 callers
Method
updated
(self, loc: &Location)
src/core/util.rs:36
↓ 3 callers
Method
__init__
(&self, mut num: i32)
tests/compiled-examples/stored_mutables.rs:183
↓ 3 callers
Method
_deanonymize
(&mut self, t: Ty, base: usize)
src/core/compile/check/mod.rs:630
↓ 3 callers
Method
attr
Get the type of an attribute of a type.
src/core/compile/check/mod.rs:771
↓ 3 callers
Function
beautify
(tokens: TokenStream)
src/core/generate/mod.rs:1828
↓ 3 callers
Function
build_namespace
Recursively build the namespace associated with `path`.
src/core/compile/namespace/mod.rs:299
↓ 3 callers
Method
check_binop_sides
( &mut self, left: &ast::Expression, right: &ast::Expression, loc: &Location,
src/core/compile/check/mod.rs:1846
↓ 3 callers
Method
check_constant
Check a constant expansion.
src/core/compile/check/mod.rs:1673
↓ 3 callers
Method
correct
Correct typenames.
src/core/compile/sign/mod.rs:170
↓ 3 callers
Method
deanonymize_pair
(&mut self, tys: (Ty, Ty))
src/core/compile/check/mod.rs:661
↓ 3 callers
Method
find_var
Find the location, if any, of a variable in scope. Returns the scope level that the variable is stored in.
src/core/compile/check/mod.rs:691
↓ 3 callers
Method
get
(&self, name: &'static str)
tests/compiled-examples/hello.rs:225
↓ 3 callers
Function
get_import_obj
Finds an imported object given a path within the namespace tree and optional extra symbol. Requires the caller to make sure that the namespace at `pa
src/core/compile/namespace/mod.rs:440
↓ 3 callers
Method
is_package
(&self)
src/core/preprocess/mod.rs:188
↓ 3 callers
Function
load_module
Load a module from path, parse and clean it. TODO unused so far, will be used when imports are really added
src/core/preprocess/mod.rs:93
↓ 3 callers
Function
order_args
Reorder `Args` into the order specified by a list of params.
src/core/compile/check/mod.rs:448
↓ 3 callers
Function
parse
(source: String)
src/core/parse/parser.rs:7
↓ 3 callers
Method
partial
(self)
src/core/clean/mod.rs:55
↓ 3 callers
Function
stored_field
(expr: TokenStream, ty: &TyExpr)
src/core/generate/mod.rs:204
↓ 2 callers
Method
add_package
Add a package (by path). Assumes that `path` definitely points to a filesystem package path.
src/core/preprocess/mod.rs:347
↓ 2 callers
Method
as_immut
(&self)
src/core/compile/ast.rs:276
↓ 2 callers
Function
build
Builds a Seahorse program.
src/bin/cli/build.rs:129
↓ 2 callers
Function
build_program
Build a single program.
src/bin/cli/build.rs:44
↓ 2 callers
Method
casted
(&self, ty: &Ty)
src/core/compile/builtin/mod.rs:89
↓ 2 callers
Method
check_binop
Check a (binary) operation that needs to unify to type `t`.
src/core/compile/check/mod.rs:1688
↓ 2 callers
Method
check_call
Typecheck a function call `f(args)` with a return value that needs to unify to type `expr_ty`.
src/core/compile/check/mod.rs:1877
↓ 2 callers
Function
clean
(program: py::Program, source: String)
src/core/clean/mod.rs:1018
↓ 2 callers
Method
clone
(&self)
tests/compiled-examples/constants.rs:69
↓ 2 callers
Function
compile
(args: CompileArgs)
src/bin/cli/compile.rs:61
↓ 2 callers
Method
deanonymize
Turn a group of anonymous free variables into contextualized free variables. Anonymouse free variables can come back from any call that might use gen
src/core/compile/check/mod.rs:625
↓ 2 callers
Function
from_template
Do some template text replacements.
src/bin/cli/init.rs:26
↓ 2 callers
Method
get_abs_path
Get an absolute path. The registry search behavior is as such: 1. Check if from+ext is a valid path (searches relative area first) 2. For each `src` (
src/core/preprocess/mod.rs:70
↓ 2 callers
Method
get_fs_package_path
Get the filesystem path for a package at this path
src/core/preprocess/mod.rs:166
↓ 2 callers
Method
is_dead
Return whether this tree is "dead" (has no leaves).
src/core/util.rs:364
↓ 2 callers
Method
is_display
Returns whether this type is Rust-`Display`.
src/core/compile/check/mod.rs:232
↓ 2 callers
Method
is_free
(&self, param: usize)
src/core/compile/check/mod.rs:2032
↓ 2 callers
Method
is_module
(&self)
src/core/preprocess/mod.rs:183
↓ 2 callers
Function
loaded_field
(expr: TokenStream, ty: &TyExpr)
src/core/generate/mod.rs:155
↓ 2 callers
Method
map_with_path
Like map, but gives you an argument containing the leaf's path.
src/core/util.rs:187
↓ 2 callers
Function
project_root
Ascend the directory tree until we reach the project root.
src/bin/cli/util.rs:32
↓ 2 callers
Method
reset
(&self)
tests/compiled-examples/stored_mutables.rs:290
↓ 2 callers
Method
reset
(self)
examples/stored_mutables.py:25
↓ 2 callers
Function
semver
(outer_re: &str, version: &str)
src/bin/cli/init.rs:44
↓ 2 callers
Method
static_attr
(&self, attr: &String)
src/core/compile/builtin/mod.rs:85
↓ 2 callers
Method
ty
(&self)
src/core/compile/builtin/mod.rs:69
↓ 2 callers
Method
with_call
(self, name: &str, args: Vec<TypedExpression>)
src/core/compile/ast.rs:399
next →
1–100 of 580, ranked by callers