Skip to content
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

feat: add libuv to provide some asynchronous functionality #432

Merged
merged 25 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
195258b
feat: implement delay async using libuv
Chronostasys Aug 12, 2024
4d7cf61
feat: support async closure
Chronostasys Aug 15, 2024
fb5e289
fix: wrong generator parameter logic
Chronostasys Aug 16, 2024
ca59e15
fix: missing libuv symbol sometimes
Chronostasys Aug 21, 2024
45032c7
fix: support await statement
Chronostasys Aug 21, 2024
dec2a67
try: build uv myself
Chronostasys Aug 28, 2024
8c2588f
try fix link issue
Chronostasys Aug 28, 2024
f1e97be
fix: cannot lgcc on linux
Chronostasys Aug 28, 2024
d5f0fd6
fix: use cmake to compile libuv && add jit load libuv logic
Chronostasys Aug 29, 2024
9665e49
fix: fuck Rust build script cfg
Chronostasys Aug 29, 2024
4db94da
fix: dylib load on macos & jit crash bug
Chronostasys Aug 30, 2024
0cf138b
fix: a macro panic issue && add beter diag msg for macro related err
Chronostasys Sep 2, 2024
6234a15
fix: global inference
Chronostasys Sep 3, 2024
8448b48
fix: use generic caches correctly in LSP
Chronostasys Sep 6, 2024
fa11c27
feat: add basic tcp listen
Chronostasys Sep 9, 2024
c858f5b
feat: add auto accept
Chronostasys Sep 9, 2024
ac1bec4
feat: make conn callback into async fn
Chronostasys Sep 10, 2024
b4e0a3e
feat: tcp read
Chronostasys Sep 12, 2024
cc556f3
feat: add stream write req
Chronostasys Sep 17, 2024
7e194b7
feat: echo server
Chronostasys Sep 17, 2024
83c0695
chore: update salsa
Chronostasys Sep 23, 2024
2e96cf2
feat: add stop ev & fix a win bug
Chronostasys Sep 27, 2024
bb08b19
feat: allow async main directly
Chronostasys Oct 9, 2024
5a4666c
fix: make ci happy
Chronostasys Oct 9, 2024
4561aed
try fix: orc jit exit error
Chronostasys Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: support await statement
  • Loading branch information
Chronostasys committed Aug 28, 2024
commit 45032c71021a7fbe219c38d5b8487d6353eeec63
2 changes: 1 addition & 1 deletion src/nomparser/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn mul_exp(input: Span) -> IResult<Span, Box<NodeEnum>> {
#[test_parser("~a")]
#[test_parser("await a")]
#[test_parser_error("+a")]
fn unary_exp(input: Span) -> IResult<Span, Box<NodeEnum>> {
pub fn unary_exp(input: Span) -> IResult<Span, Box<NodeEnum>> {
// todo: consider to aligh the implementation with UnaryExp EBNF
delspace(alt((
pointer_exp,
Expand Down
19 changes: 19 additions & 0 deletions src/nomparser/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub fn statement(input: Span) -> IResult<Span, Box<NodeEnum>> {
semi_stmt(pointer_exp, pointer_exp),
empty_statement,
comment,
semi_stmt(await_statement, await_statement),
terminated(
except(
"\n\r})",
Expand All @@ -92,6 +93,24 @@ pub fn statement(input: Span) -> IResult<Span, Box<NodeEnum>> {
)))(input)
}

#[test_parser("await a")]
fn await_statement(input: Span) -> IResult<Span, Box<NodeEnum>> {
map(
pair(tag_modifier(TokenType::AWAIT), general_exp),
|((op, r), e)| {
let range = r.start.to(e.range().end);
Box::new(
UnaryOpNode {
op: (op, r),
exp: e,
range,
}
.into(),
)
},
)(input)
}

#[test_parser("let a = 1")]
#[test_parser_error("leta = 1")]
#[test_parser("let (a, b) = 1")]
Expand Down
Loading