mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Distinguish between stringLiteral and hexStringLiteral in the JSON AST
This commit is contained in:
parent
7ad27188a0
commit
5ecc84e92e
@ -3,6 +3,7 @@
|
||||
Breaking changes:
|
||||
* Inline Assembly: Disallow ``.`` in user-defined function and variable names.
|
||||
* Inline Assembly: Slot and offset of storage pointer variable ``x`` are accessed via ``x.slot`` and ``x.offset`` instead of ``x_slot`` and ``x_offset``.
|
||||
* JSON AST: Mark hex string literals with ``kind: "hexString"``.
|
||||
* JSON AST: Remove members with ``null`` value from JSON output.
|
||||
* Parser: Disallow ``gwei`` as identifier.
|
||||
* Parser: Disallow dot syntax for ``value`` and ``gas``.
|
||||
|
@ -104,6 +104,7 @@ Declarations
|
||||
Interface Changes
|
||||
=================
|
||||
|
||||
* JSON AST: Mark hex string literals with ``kind: "hexString"``.
|
||||
* JSON AST: Members with value ``null`` are removed from JSON output.
|
||||
* NatSpec: Constructors and functions have consistent userdoc output.
|
||||
|
||||
|
@ -919,8 +919,9 @@ string ASTJsonConverter::literalTokenKind(Token _token)
|
||||
case Token::Number:
|
||||
return "number";
|
||||
case Token::StringLiteral:
|
||||
case Token::HexStringLiteral:
|
||||
return "string";
|
||||
case Token::HexStringLiteral:
|
||||
return "hexString";
|
||||
case Token::TrueLiteral:
|
||||
case Token::FalseLiteral:
|
||||
return "bool";
|
||||
|
@ -943,6 +943,8 @@ Token ASTJsonImporter::literalTokenKind(Json::Value const& _node)
|
||||
tok = Token::Number;
|
||||
else if (_node["kind"].asString() == "string")
|
||||
tok = Token::StringLiteral;
|
||||
else if (_node["kind"].asString() == "hexString")
|
||||
tok = Token::HexStringLiteral;
|
||||
else if (_node["kind"].asString() == "bool")
|
||||
tok = (member(_node, "value").asString() == "true") ? Token::TrueLiteral : Token::FalseLiteral;
|
||||
else
|
||||
|
@ -79,7 +79,7 @@
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "string",
|
||||
"kind": "hexString",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "53:7:1",
|
||||
|
@ -130,7 +130,7 @@
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"lValueRequested": false,
|
||||
"token": "string",
|
||||
"token": "hexString",
|
||||
"type": "literal_string (contains invalid UTF-8 sequence at position 0)"
|
||||
},
|
||||
"id": 5,
|
||||
|
Loading…
Reference in New Issue
Block a user