Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Oct 10, 2023
1 parent fd8c3ce commit a2c4b99
Showing 1 changed file with 85 additions and 5 deletions.
90 changes: 85 additions & 5 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2634,17 +2634,15 @@ codegen_language_macros::compile!(
Fragment(
name = SingleQuotedHexString,
scanner = Sequence([
Terminal("hex"),
Terminal("'"),
Terminal("hex'"),
Optional(Fragment(HexStringContents)),
Terminal("'")
])
),
Fragment(
name = DoubleQuotedHexString,
scanner = Sequence([
Terminal("hex"),
Terminal("\""),
Terminal("hex\""),
Optional(Fragment(HexStringContents)),
Terminal("\"")
])
Expand Down Expand Up @@ -2692,15 +2690,97 @@ codegen_language_macros::compile!(
Fragment(
name = DoubleQuotedAsciiString,
scanner = Sequence([
Terminal("'"),
Terminal("\""),
ZeroOrMore(Choice([
Fragment(EscapeSequence),
Range(' '..'!'),
Range('#'..'['),
Range(']'..'~')
])),
Terminal("\"")
])
),
Repeated(
name = UnicodeStringLiterals,
repeated = UnicodeStringLiteral,
enabled_in = "0.7.0"
),
Token(
name = UnicodeStringLiteral,
enabled_in = "0.7.0",
scanner = TrailingContext(
scanner = Choice([
Fragment(SingleQuotedUnicodeString),
Fragment(DoubleQuotedUnicodeString)
]),
not_followed_by = Fragment(IdentifierPart)
)
),
Fragment(
name = SingleQuotedUnicodeString,
enabled_in = "0.7.0",
scanner = Sequence([
Terminal("unicode'"),
ZeroOrMore(Choice([
Fragment(EscapeSequence),
Not(['\'', '\\', '\r', '\n'])
])),
Terminal("'")
])
),
Fragment(
name = DoubleQuotedUnicodeString,
enabled_in = "0.7.0",
scanner = Sequence([
Terminal("unicode\""),
ZeroOrMore(Choice([
Fragment(EscapeSequence),
Not(['"', '\\', '\r', '\n'])
])),
Terminal("\"")
])
),
Fragment(
name = EscapeSequence,
scanner = Sequence([
Terminal("\\"),
Choice([
Fragment(AsciiEscape),
Fragment(HexByteEscape),
Fragment(UnicodeEscape)
])
])
),
Fragment(
name = AsciiEscape,
scanner = Choice([
Terminal("n"),
Terminal("r"),
Terminal("t"),
Terminal("'"),
Terminal("\""),
Terminal("\\"),
Terminal("\n"),
Terminal("\r")
])
),
Fragment(
name = HexByteEscape,
scanner = Sequence([
Terminal("x"),
Fragment(HexCharacter),
Fragment(HexCharacter)
])
),
Fragment(
name = UnicodeEscape,
scanner = Sequence([
Terminal("u"),
Fragment(HexCharacter),
Fragment(HexCharacter),
Fragment(HexCharacter),
Fragment(HexCharacter)
])
)
]
),
Expand Down

0 comments on commit a2c4b99

Please sign in to comment.