Skip to content

Commit

Permalink
Reserve from and unsafe as keywords
Browse files Browse the repository at this point in the history
And also update documentation/chanelog with all the new keywords.
  • Loading branch information
axic committed Dec 10, 2019
1 parent 2b2df31 commit 218fea2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Breaking changes:
* Command line interface: Add option to disable or choose hash method between IPFS and Swarm for the bytecode metadata.
* General: Disallow explicit conversions from external function types to ``address`` and add a member called ``address`` to them as replacement.
* General: Enable Yul optimizer as part of standard optimization.
* General: New reserved keywords: ``virtual``.
* General: New reserved keywords: ``from``, ``override``, ``receive``, ``virtual``, and ``unsafe``.
* General: Split unnamed fallback functions into two cases defined using ``fallback()`` and ``receive()``.
* Standard JSON Interface: Add option to disable or choose hash method between IPFS and Swarm for the bytecode metadata.
* Syntax: ``push(element)`` for dynamic storage arrays do not return the new length anymore.
Expand Down
2 changes: 1 addition & 1 deletion docs/060-breaking-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This section lists purely syntactic changes that do not affect the behavior of e
longer possible to resize storage arrays assigning a new value to their length. Use ``push()``,
``push(value)`` or ``pop()`` instead, or assign a full array, which will of course overwrite existing content.

* New reserved keywords: ``virtual``.
* New reserved keywords: ``from``, ``override``, ``receive``, ``virtual``, and ``unsafe``.

* The names of variables declared in inline assembly may no longer end in ``_slot`` or ``_offset``.

Expand Down
6 changes: 3 additions & 3 deletions docs/miscellaneous.rst
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,10 @@ Reserved Keywords
These keywords are reserved in Solidity. They might become part of the syntax in the future:

``abstract``, ``after``, ``alias``, ``apply``, ``auto``, ``case``, ``catch``, ``copyof``, ``default``,
``define``, ``final``, ``immutable``, ``implements``, ``in``, ``inline``, ``let``, ``macro``, ``match``,
``mutable``, ``null``, ``of``, ``override``, ``partial``, ``promise``, ``reference``, ``relocatable``,
``define``, ``final``, ``from``, ``immutable``, ``implements``, ``in``, ``inline``, ``let``, ``macro``, ``match``,
``mutable``, ``null``, ``of``, ``partial``, ``promise``, ``reference``, ``relocatable``,
``sealed``, ``sizeof``, ``static``, ``supports``, ``switch``, ``try``, ``typedef``, ``typeof``,
``unchecked``, ``virtual``.
``unchecked``, ``unsafe``.

Language Grammar
================
Expand Down
2 changes: 2 additions & 0 deletions liblangutil/Token.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ namespace langutil
K(Default, "default", 0) \
K(Define, "define", 0) \
K(Final, "final", 0) \
K(From, "from", 0) \
K(Immutable, "immutable", 0) \
K(Implements, "implements", 0) \
K(In, "in", 0) \
Expand All @@ -266,6 +267,7 @@ namespace langutil
K(Typedef, "typedef", 0) \
K(TypeOf, "typeof", 0) \
K(Unchecked, "unchecked", 0) \
K(Unsafe, "unsafe", 0) \
\
/* Illegal token - not able to scan. */ \
T(Illegal, "ILLEGAL", 0) \
Expand Down

0 comments on commit 218fea2

Please sign in to comment.