diff --git a/docs/grammar/SolidityLexer.g4 b/docs/grammar/SolidityLexer.g4 index 306afd92f..0452f9fa0 100644 --- a/docs/grammar/SolidityLexer.g4 +++ b/docs/grammar/SolidityLexer.g4 @@ -90,6 +90,7 @@ Try: 'try'; Type: 'type'; Ufixed: 'ufixed' | ('ufixed' [1-9][0-9]+ 'x' [1-9][0-9]+); Unchecked: 'unchecked'; +Unicode: 'unicode'; /** * Sized unsigned integer types. * uint is an alias of uint256. diff --git a/test/libsolidity/syntaxTests/freeFunctions/invalid_function_named_unicode.sol b/test/libsolidity/syntaxTests/freeFunctions/invalid_function_named_unicode.sol new file mode 100644 index 000000000..889d7df21 --- /dev/null +++ b/test/libsolidity/syntaxTests/freeFunctions/invalid_function_named_unicode.sol @@ -0,0 +1,4 @@ +function unicode() returns {} + +// ---- +// ParserError 2314: (9-16): Expected identifier but got 'ILLEGAL' diff --git a/test/libsolidity/syntaxTests/parsing/invalid_variable_named_unicode.sol b/test/libsolidity/syntaxTests/parsing/invalid_variable_named_unicode.sol new file mode 100644 index 000000000..0180ebf73 --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/invalid_variable_named_unicode.sol @@ -0,0 +1,6 @@ +contract C +{ + string unicode = "abc"; +} +// ---- +// ParserError 2314: (24-31): Expected identifier but got 'ILLEGAL'