Adds reserved keyword virtual, and adjusting affected tests/docs respectively.

This commit is contained in:
Christian Parpart 2019-09-09 12:49:54 +02:00
parent a272506a34
commit 59955bed5d
4 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ Breaking changes:
* ABI: the ``type`` field is now required and no longer specified to default to ``function``.
* Commandline interface: remove the text-based ast printer (``--ast``).
* General: Disallow explicit conversions from external function types to ``address`` and add a member called ``address`` to them as replacement.
* General: New reserved keywords: ``virtual``.
* Type checker: Resulting type of exponentiation is equal to the type of the base. Also allow signed types for the base.
* Command line interface: Switch to the new error reporter by default. ``--old-reporter`` falls back to the deprecated old error reporter.

View File

@ -17,6 +17,8 @@ This section lists purely syntactic changes that do not affect the behavior of e
* Conversions from external function types to ``address`` are now disallowed. Instead external
function types have a member called ``address``, similar to the existing ``selector`` member.
* New reserved keywords: ``virtual``.
Semantic Only Changes
=====================

View File

@ -450,7 +450,7 @@ These keywords are reserved in Solidity. They might become part of the syntax in
``define``, ``final``, ``immutable``, ``implements``, ``in``, ``inline``, ``let``, ``macro``, ``match``,
``mutable``, ``null``, ``of``, ``override``, ``partial``, ``promise``, ``reference``, ``relocatable``,
``sealed``, ``sizeof``, ``static``, ``supports``, ``switch``, ``try``, ``typedef``, ``typeof``,
``unchecked``.
``unchecked``, ``virtual``.
Language Grammar
================

View File

@ -262,6 +262,7 @@ namespace langutil
K(Typedef, "typedef", 0) \
K(TypeOf, "typeof", 0) \
K(Unchecked, "unchecked", 0) \
K(Virtual, "virtual", 0) \
\
/* Illegal token - not able to scan. */ \
T(Illegal, "ILLEGAL", 0) \
@ -310,7 +311,7 @@ namespace TokenTraits
constexpr bool isEtherSubdenomination(Token op) { return op == Token::SubWei || op == Token::SubSzabo || op == Token::SubFinney || op == Token::SubEther; }
constexpr bool isTimeSubdenomination(Token op) { return op == Token::SubSecond || op == Token::SubMinute || op == Token::SubHour || op == Token::SubDay || op == Token::SubWeek || op == Token::SubYear; }
constexpr bool isReservedKeyword(Token op) { return (Token::Abstract <= op && op <= Token::Unchecked); }
constexpr bool isReservedKeyword(Token op) { return (Token::Abstract <= op && op <= Token::Virtual); }
inline Token AssignmentToBinaryOp(Token op)
{