-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Grant Wuerker
committed
Mar 6, 2024
1 parent
65f3804
commit 3ad97f3
Showing
13 changed files
with
170 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
unsafe { foo() } | ||
|
||
unsafe { | ||
let a = 42 | ||
std::evm::mstore(offset: 0, value: a) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
source: crates/parser2/tests/syntax_node.rs | ||
expression: node | ||
input_file: crates/parser2/test_files/syntax_node/exprs/unsafe.fe | ||
--- | ||
Root@0..97 | ||
UnsafeExpr@0..16 | ||
UnsafeKw@0..6 "unsafe" | ||
WhiteSpace@6..7 " " | ||
BlockExpr@7..16 | ||
LBrace@7..8 "{" | ||
WhiteSpace@8..9 " " | ||
ExprStmt@9..14 | ||
CallExpr@9..14 | ||
PathExpr@9..12 | ||
Path@9..12 | ||
PathSegment@9..12 | ||
Ident@9..12 "foo" | ||
CallArgList@12..14 | ||
LParen@12..13 "(" | ||
RParen@13..14 ")" | ||
WhiteSpace@14..15 " " | ||
RBrace@15..16 "}" | ||
Newline@16..18 "\n\n" | ||
UnsafeExpr@18..96 | ||
UnsafeKw@18..24 "unsafe" | ||
WhiteSpace@24..25 " " | ||
BlockExpr@25..96 | ||
LBrace@25..26 "{" | ||
Newline@26..27 "\n" | ||
WhiteSpace@27..31 " " | ||
LetStmt@31..41 | ||
LetKw@31..34 "let" | ||
WhiteSpace@34..35 " " | ||
PathPat@35..36 | ||
Path@35..36 | ||
PathSegment@35..36 | ||
Ident@35..36 "a" | ||
WhiteSpace@36..37 " " | ||
Eq@37..38 "=" | ||
WhiteSpace@38..39 " " | ||
LitExpr@39..41 | ||
Lit@39..41 | ||
Int@39..41 "42" | ||
Newline@41..42 "\n" | ||
WhiteSpace@42..46 " " | ||
ExprStmt@46..83 | ||
CallExpr@46..83 | ||
PathExpr@46..62 | ||
Path@46..62 | ||
PathSegment@46..49 | ||
Ident@46..49 "std" | ||
Colon2@49..51 "::" | ||
PathSegment@51..54 | ||
Ident@51..54 "evm" | ||
Colon2@54..56 "::" | ||
PathSegment@56..62 | ||
Ident@56..62 "mstore" | ||
CallArgList@62..83 | ||
LParen@62..63 "(" | ||
CallArg@63..72 | ||
Ident@63..69 "offset" | ||
Colon@69..70 ":" | ||
WhiteSpace@70..71 " " | ||
LitExpr@71..72 | ||
Lit@71..72 | ||
Int@71..72 "0" | ||
Comma@72..73 "," | ||
WhiteSpace@73..74 " " | ||
CallArg@74..82 | ||
Ident@74..79 "value" | ||
Colon@79..80 ":" | ||
WhiteSpace@80..81 " " | ||
PathExpr@81..82 | ||
Path@81..82 | ||
PathSegment@81..82 | ||
Ident@81..82 "a" | ||
RParen@82..83 ")" | ||
Newline@83..84 "\n" | ||
WhiteSpace@84..88 " " | ||
ReturnStmt@88..94 | ||
ReturnKw@88..94 "return" | ||
Newline@94..95 "\n" | ||
RBrace@95..96 "}" | ||
Newline@96..97 "\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,8 @@ let x = if b { | |
let x = match b { | ||
MyEnum::A(x) | MyEnum::B(x) => x | ||
_ => 0 | ||
} | ||
|
||
let z = unsafe { | ||
foo() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ source: crates/parser2/tests/syntax_node.rs | |
expression: node | ||
input_file: crates/parser2/test_files/syntax_node/stmts/let.fe | ||
--- | ||
Root@0..231 | ||
Root@0..261 | ||
LetStmt@0..5 | ||
LetKw@0..3 "let" | ||
WhiteSpace@3..4 " " | ||
|
@@ -298,4 +298,33 @@ [email protected] | |
Int@228..229 "0" | ||
Newline@229..230 "\n" | ||
RBrace@230..231 "}" | ||
Newline@231..233 "\n\n" | ||
LetStmt@233..261 | ||
LetKw@233..236 "let" | ||
WhiteSpace@236..237 " " | ||
PathPat@237..238 | ||
Path@237..238 | ||
PathSegment@237..238 | ||
Ident@237..238 "z" | ||
WhiteSpace@238..239 " " | ||
Eq@239..240 "=" | ||
WhiteSpace@240..241 " " | ||
UnsafeExpr@241..261 | ||
UnsafeKw@241..247 "unsafe" | ||
WhiteSpace@247..248 " " | ||
BlockExpr@248..261 | ||
LBrace@248..249 "{" | ||
Newline@249..250 "\n" | ||
WhiteSpace@250..254 " " | ||
ExprStmt@254..259 | ||
CallExpr@254..259 | ||
PathExpr@254..257 | ||
Path@254..257 | ||
PathSegment@254..257 | ||
Ident@254..257 "foo" | ||
CallArgList@257..259 | ||
LParen@257..258 "(" | ||
RParen@258..259 ")" | ||
Newline@259..260 "\n" | ||
RBrace@260..261 "}" | ||
|