Commit Graph

225 Commits

Author SHA1 Message Date
Mathias Baumann
e35a23bbcc Add `switch (..) to style checker 2019-11-11 17:44:21 +01:00
Christian Parpart
df729b3084 Make use of C++17 std::optional<> instead of boost::optional<>. 2019-10-28 11:39:30 +01:00
Christian Parpart
00d7dac15f Fixes source location in warning for shadowing import delcarations. 2019-09-30 11:45:46 +02:00
rocky
f9b631f410 A pragma version mismatch is not fatal if ...
error recovery is desired.

Fixes #7085
2019-07-17 19:01:01 -04:00
rocky
ca3afea1d7 Add Steve Johnson-style parser recovery rules:
SourceUnit = Error $
    Block = '{' Error '}'
    ContractDefinition = '{' Error '}'
    Statement = Error ';'

Co-Authored-By: chriseth <chris@ethereum.org>
2019-06-17 14:47:07 +02:00
chriseth
4ee703e6e5 Revert "Add Steve Johnson-style parser recovery rules:"
This reverts commit 97f8ee0d1b.
2019-05-28 18:09:24 +02:00
rocky
97f8ee0d1b Add Steve Johnson-style parser recovery rules:
SourceUnit = Error $
    Block = '{' Error '}'
    ContractDefinition = '{' Error '}'
    Statement = Error ';'

Co-Authored-By: chriseth <chris@ethereum.org>
2019-05-28 15:06:34 +02:00
chriseth
9a00729ce7 Provide dialect to Parser and InlineAssembly AST nodes. 2019-05-23 00:24:58 +02:00
Erik Kundt
656364d967 Fixes Natspec parser error when whitespace is missing. 2019-05-10 10:53:32 +02:00
rocky
b424446c5f Move SemVerHandler to analysis to parsing to increase modularity...
If ever you want to separate building analysis from scanning/parsing/ast, this will help.
2019-04-17 10:13:42 -04:00
Mathias Baumann
efc8d79d53 Fix wrong location for inline asm blocks 2019-04-15 16:40:07 +02:00
Christian Parpart
bb28c8a877 Fixes wrong source location when reporting pragma solidity version conflicts. 2019-03-20 11:42:25 +01:00
chriseth
9a949c1bda Set default EVM version to Petersburg. 2019-03-04 14:53:00 +01:00
Alex Beregszaszi
ecd246aeb6 Support petersburg in evmVersion 2019-03-04 14:10:41 +01:00
chriseth
7f5b335b47 Make EVM version part of EVM dialect. 2019-02-21 21:59:46 +01:00
Alex Beregszaszi
fcf884f201 Do not ignore fatal error in AsmParser for inline assembly 2019-02-21 16:18:53 +00:00
chriseth
1a823f0bf8 Fix tabs/spaces. 2019-02-13 17:05:48 +01:00
Alex Beregszaszi
021d30f036 Use specific boost include in DocStringParser
This is needed for C++17 support (at least on certain Boost and OS combinations)
2019-01-31 13:14:29 +00:00
Alex Beregszaszi
9aafa32825 Disallow empty import statements 2019-01-28 13:52:15 +00:00
chriseth
2fcfb216b5 Syntax for meta type information. 2019-01-17 20:36:48 +01:00
Christian Parpart
62fe57479e
make use of C++ = default constructor declarations as well as more non-static member initialization syntax. 2018-12-19 11:26:42 +01:00
Christian Parpart
d10bae245e
liblangutil: SourceLocation to default initialize data members (w/o the use of ctor)
See: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-in-class-member-initializers-instead
2018-12-19 11:21:45 +01:00
Alex Beregszaszi
c2ec6d71b4 Add version pragma parsing to Parser 2018-12-18 15:02:35 +00:00
Leonardo Alt
7f41487ff6 Sort includes in libsolidity/parsing 2018-12-17 19:28:10 +01:00
chriseth
fb3a0ac1c7 Codegen for object access. 2018-12-11 19:24:44 +01:00
Mathias Baumann
2f6dc2e773 Replace push_back with emplace_back where it makes sense 2018-12-10 19:02:39 +01:00
Christian Parpart
c48a5264be
liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName
Also, adapted affecting code to those changes.
2018-11-30 17:07:12 +01:00
Christian Parpart
e4106bd06e Change scanner error diagnostics to be non-intrusive to the token API.
This also implicitly eliminates the magic-token Token::IllegalHex, and
streamlines error diagnostics over a custom enum class.
2018-11-24 12:40:51 +01:00
Lazaridis
e454737a3c adapt to latest code changes 2018-11-23 17:27:52 +01:00
Christian Parpart
ec47c8946b
Isolating libyul library API into its own namespace yul. 2018-11-23 14:29:00 +01:00
Christian Parpart
713d94476e Reorder some include files and group <libyul/>'s together (as much as possible) 2018-11-23 12:37:19 +01:00
Christian Parpart
0f4ed52a71
Rewrite header paths to adapt to recent git mv of libsolidity/inlineasm to libyul 2018-11-23 11:18:57 +01:00
Christian Parpart
d67322a186 Introduce namespace langutil in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
Christian Parpart
87821c53c3 Isolating files shared between Yul- and Solidity language frontend. 2018-11-21 18:58:12 +00:00
Leonardo Alt
9a4fd946c3 Add Scanner function that prints source based on SourceLocation 2018-11-13 13:49:29 +01:00
chriseth
af65bac737 Remove trailing whitespace. 2018-11-12 09:15:22 +01:00
Christian Parpart
f112377dd4
Refactor solidity::Token into an enum class with TokenTraits helper namespace 2018-10-22 17:00:51 +02:00
chriseth
06200b4b64
Merge pull request #5180 from ethereum/cpp-cleanup
Some C++ cleanup
2018-10-10 11:43:42 +02:00
Alex Beregszaszi
6c3d12d85b Do not require ctype/stdio if not needed 2018-10-09 19:06:22 +01:00
Lazaridis
4bcd89105c provide general hex-literal error message, fixes #1802
dummy
2018-10-09 06:51:19 +03:00
Alex Beregszaszi
fa0ce6a7e7 Use empty() instead of size() == 0 2018-10-09 04:29:37 +01:00
chriseth
d76bfcd935 Fix typos. 2018-10-04 13:28:16 +02:00
hydai
b409faa675
Disallow uppercase X in hex number literals 2018-09-19 22:01:15 +08:00
Daniel Kirchner
1ce3581a52 Accept `address payable` during parsing. 2018-09-11 14:52:23 +02:00
chriseth
0b7b8162ca This fixes several bugs with regards to line breaks and comments:
- any unicode line break (line feed, vertical tab, form feed, carriage
   return, NEL, LS and PS) is considered to terminate a single-line
   comment. The line break itself is considered to be the next token
   after the comment, leading to a parser error if it is not an
   ascii character (i.e. for NEL, LS and PS).
 - unterminated multiline comments are considered illegal tokens
 - '/** /' is considered an unterminated multiline comment
   (previously, whitespace was allowed before the last '/'
2018-09-06 16:42:59 +02:00
chriseth
977ac9c390 Refactor handling of whitespace. 2018-09-06 16:42:59 +02:00
Daniel Kirchner
f020f96b6c More consistently use parse*() functions without argument in the parser. 2018-09-06 14:55:07 +02:00
chriseth
85debe77d9
Merge pull request #4866 from bakaoh/issue4743
Fix#4743: Incorrect source location for nameless parameters
2018-09-04 20:21:03 +02:00
Daniel Kirchner
a102f3b783 Remove trailing whitespace for all files in the repository. 2018-09-04 11:30:30 +02:00
bakaoh
c458f5988b Fix#4743: Incorrect source location for nameless parameters 2018-08-28 11:11:40 +07:00