Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fix-lists-in-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 22, 2023
2 parents 23f8804 + a90a6fe commit 6555c10
Show file tree
Hide file tree
Showing 221 changed files with 579 additions and 634 deletions.
10 changes: 1 addition & 9 deletions crates/codegen/schema/src/validation/rules/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,5 @@ pub fn is_a_keyword_scanner(reference_name: &str) -> bool {
// In the meantime, let's just skip them from this validation.
// https://github.com/NomicFoundation/slang/issues/505

return match reference_name {
"FixedBytesType"
| "SignedFixedType"
| "UnsignedFixedType"
| "SignedIntegerType"
| "UnsignedIntegerType" => true,
keyword if keyword.contains("Keyword") || keyword.contains("ReservedWord") => true,
_ => false,
};
reference_name.contains("Keyword") || reference_name.contains("ReservedWord")
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
- reference: "ByteKeyword"
- reference: "StringKeyword"
- reference: "AddressType"
- reference: "FixedBytesType"
- reference: "SignedIntegerType"
- reference: "UnsignedIntegerType"
- reference: "SignedFixedType"
- reference: "UnsignedFixedType"
- reference: "BytesKeyword"
- reference: "IntKeyword"
- reference: "UintKeyword"
- reference: "FixedKeyword"
- reference: "UfixedKeyword"
0.8.0:
# removed: ByteKeyword
choice:
- reference: "BoolKeyword"
- reference: "StringKeyword"
- reference: "AddressType"
- reference: "FixedBytesType"
- reference: "SignedIntegerType"
- reference: "UnsignedIntegerType"
- reference: "SignedFixedType"
- reference: "UnsignedFixedType"
- reference: "BytesKeyword"
- reference: "IntKeyword"
- reference: "UintKeyword"
- reference: "FixedKeyword"
- reference: "UfixedKeyword"

- name: "AddressType"
kind: "Parser"
Expand All @@ -37,7 +37,7 @@
reference: "PayableKeyword"
- reference: "PayableKeyword"

- name: "FixedBytesType"
- name: "BytesKeyword"
kind: "Scanner"
unversioned:
trailingContext:
Expand Down Expand Up @@ -86,7 +86,7 @@
- terminal: "31"
- terminal: "32"

- name: "SignedIntegerType"
- name: "IntKeyword"
kind: "Scanner"
unversioned:
trailingContext:
Expand All @@ -98,7 +98,7 @@
notFollowedBy:
reference: "IdentifierPart"

- name: "UnsignedIntegerType"
- name: "UintKeyword"
kind: "Scanner"
unversioned:
trailingContext:
Expand Down Expand Up @@ -148,7 +148,7 @@
- terminal: "248"
- terminal: "256"

- name: "SignedFixedType"
- name: "FixedKeyword"
kind: "Scanner"
unversioned:
trailingContext:
Expand All @@ -160,7 +160,7 @@
notFollowedBy:
reference: "IdentifierPart"

- name: "UnsignedFixedType"
- name: "UfixedKeyword"
kind: "Scanner"
unversioned:
trailingContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
unversioned:
choice:
# Types
- reference: "FixedBytesType"
- reference: "SignedFixedType"
- reference: "UnsignedFixedType"
- reference: "SignedIntegerType"
- reference: "UnsignedIntegerType"
- reference: "BytesKeyword"
- reference: "FixedKeyword"
- reference: "UfixedKeyword"
- reference: "IntKeyword"
- reference: "UintKeyword"
# Keywords
- reference: "AddressKeyword"
- reference: "AnonymousKeyword"
Expand Down
143 changes: 48 additions & 95 deletions crates/solidity/inputs/language/src/definition.rs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions crates/solidity/inputs/language/src/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ slang_grammar! {
parser DoWhileStatement = ((DoKeyword Statement WhileKeyword (Expression delimited by OpenParen and CloseParen)) terminated by Semicolon) ;

inline parser ElementaryType = (
BoolKeyword | StringKeyword | AddressType | FixedBytesType | SignedIntegerType | UnsignedIntegerType | SignedFixedType | UnsignedFixedType |
BoolKeyword | StringKeyword | AddressType | BytesKeyword | IntKeyword | UintKeyword | FixedKeyword | UfixedKeyword |
{ removed in "0.8.0" ByteKeyword}
) ;

Expand Down Expand Up @@ -768,11 +768,11 @@ slang_grammar! {

// Constructed Identifiers (Typenames)

scanner FixedBytesType = ("bytes" FixedBytesTypeSize) ;
scanner SignedFixedType = ("fixed" (FixedTypeSize ?)) ;
scanner SignedIntegerType = ("int" (IntegerTypeSize ?)) ;
scanner UnsignedFixedType = ("ufixed" (FixedTypeSize ?)) ;
scanner UnsignedIntegerType = ("uint" (IntegerTypeSize ?)) ;
scanner BytesKeyword = ("bytes" FixedBytesTypeSize) ;
scanner FixedKeyword = ("fixed" (FixedTypeSize ?)) ;
scanner IntKeyword = ("int" (IntegerTypeSize ?)) ;
scanner UfixedKeyword = ("ufixed" (FixedTypeSize ?)) ;
scanner UintKeyword = ("uint" (IntegerTypeSize ?)) ;

scanner FixedBytesTypeSize = (
"1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" |
Expand Down
10 changes: 5 additions & 5 deletions crates/solidity/outputs/cargo/crate/src/generated/kinds.rs

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

Loading

0 comments on commit 6555c10

Please sign in to comment.