mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change error from directive to keyword.
This commit is contained in:
committed by
hrkrshnn
parent
a942e630d4
commit
9d5b1b279e
@@ -0,0 +1,28 @@
|
||||
********************************
|
||||
Solidity v0.8.0 Breaking Changes
|
||||
********************************
|
||||
|
||||
This section highlights the main breaking changes introduced in Solidity
|
||||
version 0.9.0.
|
||||
For the full list check
|
||||
`the release changelog <https://github.com/ethereum/solidity/releases/tag/v0.9.0>`_.
|
||||
|
||||
Silent Changes of the Semantics
|
||||
===============================
|
||||
|
||||
...
|
||||
|
||||
New Restrictions
|
||||
================
|
||||
|
||||
- `error` is now a keyword and cannot be used as identifier anymore.
|
||||
|
||||
Interface Changes
|
||||
=================
|
||||
|
||||
...
|
||||
|
||||
How to update your code
|
||||
=======================
|
||||
|
||||
...
|
||||
@@ -29,7 +29,7 @@ Do: 'do';
|
||||
Else: 'else';
|
||||
Emit: 'emit';
|
||||
Enum: 'enum';
|
||||
Error: 'error'; // not a real keyword
|
||||
Error: 'error';
|
||||
Revert: 'revert'; // not a real keyword
|
||||
Event: 'event';
|
||||
External: 'external';
|
||||
|
||||
@@ -13,6 +13,7 @@ sourceUnit: (
|
||||
pragmaDirective
|
||||
| importDirective
|
||||
| contractDefinition
|
||||
| errorDefinition
|
||||
| interfaceDefinition
|
||||
| libraryDefinition
|
||||
| functionDefinition
|
||||
@@ -379,9 +380,9 @@ tupleExpression: LParen (expression? ( Comma expression?)* ) RParen;
|
||||
inlineArrayExpression: LBrack (expression ( Comma expression)* ) RBrack;
|
||||
|
||||
/**
|
||||
* Besides regular non-keyword Identifiers, some keywords like 'from' and 'error' can also be used as identifiers.
|
||||
* Besides regular non-keyword Identifiers, some keywords like 'from' can also be used as identifiers.
|
||||
*/
|
||||
identifier: Identifier | From | Error | Revert;
|
||||
identifier: Identifier | From | Revert;
|
||||
|
||||
literal: stringLiteral | numberLiteral | booleanLiteral | hexStringLiteral | unicodeStringLiteral;
|
||||
booleanLiteral: True | False;
|
||||
|
||||
+4
-3
@@ -28,8 +28,8 @@ a 0.x version number `to indicate this fast pace of change <https://semver.org/#
|
||||
|
||||
.. warning::
|
||||
|
||||
Solidity recently released the 0.8.x version that introduced a lot of breaking
|
||||
changes. Make sure you read :doc:`the full list <080-breaking-changes>`.
|
||||
Solidity recently released the 0.9.x version that introduced a lot of breaking
|
||||
changes. Make sure you read :doc:`the full list <090-breaking-changes>`.
|
||||
|
||||
Ideas for improving Solidity or this documentation are always welcome,
|
||||
read our :doc:`contributors guide <contributing>` for more details.
|
||||
@@ -155,6 +155,7 @@ Contents
|
||||
060-breaking-changes.rst
|
||||
070-breaking-changes.rst
|
||||
080-breaking-changes.rst
|
||||
090-breaking-changes.rst
|
||||
natspec-format.rst
|
||||
security-considerations.rst
|
||||
smtchecker.rst
|
||||
@@ -165,4 +166,4 @@ Contents
|
||||
bugs.rst
|
||||
contributing.rst
|
||||
brand-guide.rst
|
||||
language-influences.rst
|
||||
language-influences.rst
|
||||
|
||||
Reference in New Issue
Block a user