Skip to content

Commit

Permalink
WIP: Adjust generated code for YulBlock fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 9, 2023
1 parent 3f07c07 commit 8e11a12
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 41 deletions.
15 changes: 10 additions & 5 deletions crates/solidity/outputs/cargo/crate/src/generated/language.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions crates/solidity/outputs/npm/crate/src/generated/language.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ { │ 0..1
2 │ function mult(a, b) -> result { │ 2..34
3 │ result := mul(a, b) │ 35..56
4 │ } │ 57..59
5 │ } │ 60..61
Errors: []

Tree:
- YulBlock (Rule): # 0..62 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..."
- OpenBrace (Token): "{" # 0..1
- YulStatements (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulStatement (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulFunctionDefinition (Rule): # 2..60 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulFunctionKeyword (Token): "function" # 3..11
- YulIdentifier (Token): "mult" # 12..16
- YulParametersDeclaration (Rule): # 16..22 "(a, b)"
- OpenParen (Token): "(" # 16..17
- YulParameters (Rule): # 17..21 "a, b"
- YulIdentifier (Token): "a" # 17..18
- Comma (Token): "," # 18..19
- YulIdentifier (Token): "b" # 20..21
- CloseParen (Token): ")" # 21..22
- YulReturnsDeclaration (Rule): # 22..32 " -> result"
- MinusGreaterThan (Token): "->" # 23..25
- YulReturnVariables (Rule): # 25..32 " result"
- YulIdentifier (Token): "result" # 26..32
- YulBlock (Rule): # 32..60 " {\n\t\tresult := mul(a, b)\n\t}\n"
- OpenBrace (Token): "{" # 33..34
- YulStatements (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulIdentifierPaths (Rule): # 35..43 "\t\tresult"
- YulIdentifierPath (Rule): # 35..43 "\t\tresult"
- YulIdentifier (Token): "result" # 37..43
- ColonEqual (Token): ":=" # 44..46
- YulExpression (Rule): # 46..57 " mul(a, b)\n"
- YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n"
- YulExpression (Rule): # 46..50 " mul"
- YulIdentifierPath (Rule): # 46..50 " mul"
- YulIdentifier (Token): "mul" # 47..50
- OpenParen (Token): "(" # 50..51
- YulArguments (Rule): # 51..55 "a, b"
- YulExpression (Rule): # 51..52 "a"
- YulIdentifierPath (Rule): # 51..52 "a"
- YulIdentifier (Token): "a" # 51..52
- Comma (Token): "," # 52..53
- YulExpression (Rule): # 53..55 " b"
- YulIdentifierPath (Rule): # 53..55 " b"
- YulIdentifier (Token): "b" # 54..55
- CloseParen (Token): ")" # 55..56
- CloseBrace (Token): "}" # 58..59
- CloseBrace (Token): "}" # 60..61
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,62 @@ Source: >
Errors: # 1 total
- >
Error: Expected OpenParen.
╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:1:1]
Error: Expected AsciiStringLiteral or CloseBrace or HexStringLiteral or OpenBrace or YulBreakKeyword or YulContinueKeyword or YulDecimalLiteral or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulLetKeyword or YulSwitchKeyword or YulTrueKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:4:10]
1 │ ╭─▶ {
┆ ┆
6 │ ├─▶ }
│ │
│ ╰─────── Error occurred here.
4 │ ╭─▶ result := [mul(a, b)
5 │ ├─▶ }
│ │
│ ╰─────────── Error occurred here.
───╯
Tree:
- SKIPPED (Token): "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..." # 0..85
- YulBlock (Rule): # 0..85 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..."
- OpenBrace (Token): "{" # 0..1
- YulStatements (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulStatement (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulFunctionKeyword (Token): "function" # 3..11
- YulIdentifier (Token): "mult" # 12..16
- YulParametersDeclaration (Rule): # 16..22 "(a, b)"
- OpenParen (Token): "(" # 16..17
- YulParameters (Rule): # 17..21 "a, b"
- YulIdentifier (Token): "a" # 17..18
- Comma (Token): "," # 18..19
- YulIdentifier (Token): "b" # 20..21
- CloseParen (Token): ")" # 21..22
- YulReturnsDeclaration (Rule): # 22..32 " -> result"
- MinusGreaterThan (Token): "->" # 23..25
- YulReturnVariables (Rule): # 25..32 " result"
- YulIdentifier (Token): "result" # 26..32
- YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..."
- OpenBrace (Token): "{" # 33..34
- YulStatements (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult"
- YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulIdentifierPaths (Rule): # 35..43 "\t\tresult"
- YulIdentifierPath (Rule): # 35..43 "\t\tresult"
- YulIdentifier (Token): "result" # 37..43
- ColonEqual (Token): ":=" # 44..46
- YulExpression (Rule): # 46..57 " mul(a, b)\n"
- YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n"
- YulExpression (Rule): # 46..50 " mul"
- YulIdentifierPath (Rule): # 46..50 " mul"
- YulIdentifier (Token): "mul" # 47..50
- OpenParen (Token): "(" # 50..51
- YulArguments (Rule): # 51..55 "a, b"
- YulExpression (Rule): # 51..52 "a"
- YulIdentifierPath (Rule): # 51..52 "a"
- YulIdentifier (Token): "a" # 51..52
- Comma (Token): "," # 52..53
- YulExpression (Rule): # 53..55 " b"
- YulIdentifierPath (Rule): # 53..55 " b"
- YulIdentifier (Token): "b" # 54..55
- CloseParen (Token): ")" # 55..56
- YulStatement (Rule): # 57..65 "\t\tresult"
- YulExpression (Rule): # 57..65 "\t\tresult"
- YulIdentifierPath (Rule): # 57..65 "\t\tresult"
- YulIdentifier (Token): "result" # 59..65
- SKIPPED (Token): ":= [mul(a, b)\n\t" # 66..81
- CloseBrace (Token): "}" # 81..82
- CloseBrace (Token): "}" # 83..84
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ { │ 0..1
2 │ function mult(a, b) -> result { │ 2..34
3 │ result := mul(a, b) │ 35..56
4 │ result := [mul(a, b) │ 57..79
5 │ } │ 80..82
6 │ } │ 83..84
Errors: # 1 total
- >
Error: Expected AsciiStringLiteral or CloseBrace or HexStringLiteral or OpenBrace or YulBreakKeyword or YulContinueKeyword or YulDecimalLiteral or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulLeaveKeyword or YulLetKeyword or YulSwitchKeyword or YulTrueKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:4:10]
4 │ ╭─▶ result := [mul(a, b)
5 │ ├─▶ }
│ │
│ ╰─────────── Error occurred here.
───╯
Tree:
- YulBlock (Rule): # 0..85 "{\n\tfunction mult(a, b) -> result {\n\t\tresult := mul..."
- OpenBrace (Token): "{" # 0..1
- YulStatements (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulStatement (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulFunctionDefinition (Rule): # 2..83 "\tfunction mult(a, b) -> result {\n\t\tresult := mul(a..."
- YulFunctionKeyword (Token): "function" # 3..11
- YulIdentifier (Token): "mult" # 12..16
- YulParametersDeclaration (Rule): # 16..22 "(a, b)"
- OpenParen (Token): "(" # 16..17
- YulParameters (Rule): # 17..21 "a, b"
- YulIdentifier (Token): "a" # 17..18
- Comma (Token): "," # 18..19
- YulIdentifier (Token): "b" # 20..21
- CloseParen (Token): ")" # 21..22
- YulReturnsDeclaration (Rule): # 22..32 " -> result"
- MinusGreaterThan (Token): "->" # 23..25
- YulReturnVariables (Rule): # 25..32 " result"
- YulIdentifier (Token): "result" # 26..32
- YulBlock (Rule): # 32..83 " {\n\t\tresult := mul(a, b)\n\t\tresult := [mul(a, b)\n\t}..."
- OpenBrace (Token): "{" # 33..34
- YulStatements (Rule): # 35..65 "\t\tresult := mul(a, b)\n\t\tresult"
- YulStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulAssignmentStatement (Rule): # 35..57 "\t\tresult := mul(a, b)\n"
- YulIdentifierPaths (Rule): # 35..43 "\t\tresult"
- YulIdentifierPath (Rule): # 35..43 "\t\tresult"
- YulIdentifier (Token): "result" # 37..43
- ColonEqual (Token): ":=" # 44..46
- YulExpression (Rule): # 46..57 " mul(a, b)\n"
- YulFunctionCallExpression (Rule): # 46..57 " mul(a, b)\n"
- YulExpression (Rule): # 46..50 " mul"
- YulIdentifierPath (Rule): # 46..50 " mul"
- YulIdentifier (Token): "mul" # 47..50
- OpenParen (Token): "(" # 50..51
- YulArguments (Rule): # 51..55 "a, b"
- YulExpression (Rule): # 51..52 "a"
- YulIdentifierPath (Rule): # 51..52 "a"
- YulIdentifier (Token): "a" # 51..52
- Comma (Token): "," # 52..53
- YulExpression (Rule): # 53..55 " b"
- YulIdentifierPath (Rule): # 53..55 " b"
- YulIdentifier (Token): "b" # 54..55
- CloseParen (Token): ")" # 55..56
- YulStatement (Rule): # 57..65 "\t\tresult"
- YulExpression (Rule): # 57..65 "\t\tresult"
- YulIdentifierPath (Rule): # 57..65 "\t\tresult"
- YulIdentifier (Token): "result" # 59..65
- SKIPPED (Token): ":= [mul(a, b)\n\t" # 66..81
- CloseBrace (Token): "}" # 81..82
- CloseBrace (Token): "}" # 83..84

0 comments on commit 8e11a12

Please sign in to comment.