-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support native stdlib #201
Changes from 1 commit
fbfa222
4eaed5b
10432c3
0221102
5353d42
253f4b5
64f1758
be66e55
6f26d5b
b283046
00d230b
1d2cba7
9b94dfb
64c2352
3c0b022
f54a53c
5c8918e
18825a3
ca35175
55f441a
2b47a8d
8ef0993
1f8826a
8834fff
a822a1b
3f91646
c2c78c9
328ffbf
7befb6b
42a520a
be8127d
665ef2e
ab75d85
34cf5c4
4cfb0c5
eb1def1
83e3491
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ pub fn init_stdlib_dep<B: Backend>( | |
sources: &mut Sources, | ||
tast: &mut TypeChecker<B>, | ||
node_id: usize, | ||
path_prefix: &str, | ||
) -> usize { | ||
// list the stdlib dependency in order | ||
let libs = vec!["bits", "int", "comparator"]; | ||
|
@@ -95,7 +96,7 @@ pub fn init_stdlib_dep<B: Backend>( | |
|
||
for lib in libs { | ||
let module = UserRepo::new(&format!("std/{}", lib)); | ||
let prefix_stdlib = Path::new("src/stdlib/native/"); | ||
let prefix_stdlib = Path::new(path_prefix); | ||
let code = std::fs::read_to_string(prefix_stdlib.join(format!("{lib}.no"))).unwrap(); | ||
node_id = | ||
typecheck_next_file(tast, Some(module), sources, lib.to_string(), code, 0).unwrap(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should really have a pass that lists the dependencies use, with this approach we're processing a bunch of stdlibs that might not even be used :o There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cf #29 |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that a temporary solution :D
one thing we could do is have a github workflow to remove everything but the lib and push that on a
stdlib
branch or something. This way we can justgit clone
this repo with only the latest commit on that branch. wdyt?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise it feels a bit wasteful to import all of noname?
ALTHOUGH, it would be cool if, when people click on "go to definition" we could also point to the source code of noname
so it might be an upside to have the whole noname code pulled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create a release branch for now? so we can decide which version of main branch to be merged into the release branch for auto-download