Commit Graph

72 Commits

Author SHA1 Message Date
hrkrshnn
9f7426b4a9 Implemented parsing for UserDefinedValueType
Also added parsing tests.
2021-09-07 19:42:51 +02:00
Christian Parpart
d203c80abd Eliminate unnecessary m_source from Parser 2021-08-03 16:03:45 +02:00
chriseth
ffc5cfd9a5 Remove scanner from compiler stack. 2021-08-03 15:43:17 +02:00
chriseth
fb67051467 Revert statement. 2021-03-30 21:15:46 +02:00
chriseth
b04b189959 Syntax for custom errors. 2021-03-30 21:15:18 +02:00
chriseth
3d97e9a77b Properly parse address member. 2021-02-24 16:44:16 +01:00
Christian Parpart
32ba5f5ae7 libsolidity: Extend the AST for named AST nodes in order to get precise locations for names.
The actual SourceLocation on an ASTNode is representing the whole
ASTNode whereas in an LSP (for example) you are also interested in the
SourceLocation of a name of a construct (e.g. variable decarlation, function definition, ...).

This also properly encodes non-existend sources as `-1` in the JSON output (eliminating the use of `numeric_limits<size_t>::max()`).
2021-02-10 18:13:09 +01:00
chriseth
527c073bb9 Checked arithmetic by default. 2020-10-19 16:58:37 +02:00
Mathias Baumann
0b7b174945 Add AST Node IdentifierPath 2020-10-13 14:32:11 +02:00
chriseth
346fe1c6c5 Constants at file-level. 2020-10-08 18:56:17 +02:00
chriseth
9324fb4f20 Free functions. 2020-08-18 11:46:59 +02:00
chriseth
9be5ed1220 Merge remote-tracking branch 'origin/develop' into breaking 2020-07-21 11:35:28 +02:00
chriseth
93c792c696 Remove special treatment of `var`. 2020-07-20 17:22:04 +02:00
Sachin Grover
b7adb2aa42 Add SPDX license identifier if not present already in source file
Fixes: #9220
2020-07-17 20:24:12 +05:30
chriseth
3872a1f000 Add support for SPDX license identifiers. 2020-05-13 18:16:59 +02:00
Erik Kundt
ec27c2e507 Introduce AST node for structured documentation. 2020-01-30 18:25:56 +01:00
Mathias Baumann
a3f23d3158 Implement new with CREATE2 and function call options. 2020-01-23 21:20:01 +01:00
djudjuu
e8556fa1b2 Ast-Import from standard-json 2020-01-14 17:15:53 +01:00
chriseth
5ca3abd7cb
Merge pull request #8106 from random-internet-cat/move-contract-kind
Move ContractKind from ContractDefinition to file-scope
2020-01-08 13:06:26 +01:00
Christian Parpart
6b23412fae C++ namespace cleanup (except tests). 2020-01-07 15:51:50 +01:00
Jason Cobb
529405deb6
Move ContractKind from ContractDefinition to file-scope 2020-01-07 09:11:29 -05:00
chriseth
90feb8f72a Move Visibility out of Declaration. 2019-12-11 00:38:59 +01:00
Mathias Baumann
5b8ff78176 Implement virtual keyword 2019-11-14 11:49:39 +01:00
Mathias Baumann
7d4e4b6088 Parse "virtual" keyword 2019-11-13 13:28:01 +01:00
Daniel Kirchner
3321fc56ea Split fallback function and introduce "fallback()" and "receive()" syntax. 2019-11-04 17:17:58 +01:00
Alexander Arlt
62950a9234 Support for abstract contracts. 2019-11-01 14:54:47 -05:00
chriseth
6d6914f98f Parser for try/catch. 2019-09-23 17:22:42 +02:00
Daniel Kirchner
4782c800ec Initial introduction of array slices with partial implementation for dynamic calldata arrays. 2019-09-13 10:57:53 +02:00
Mathias Baumann
24716404f8 Parse override keyword 2019-08-26 17:34:21 +02: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
Christian Parpart
bb28c8a877 Fixes wrong source location when reporting pragma solidity version conflicts. 2019-03-20 11:42:25 +01:00
chriseth
1a823f0bf8 Fix tabs/spaces. 2019-02-13 17:05: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
Alex Beregszaszi
c2ec6d71b4 Add version pragma parsing to Parser 2018-12-18 15:02:35 +00: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
Daniel Kirchner
f020f96b6c More consistently use parse*() functions without argument in the parser. 2018-09-06 14:55:07 +02:00
Erik Kundt
182a0a9551 Disallows old constructor syntax. 2018-07-18 14:29:01 +02:00
chriseth
fe8f38a7a4 Assert integrity of empty IndexAccessPath structure. 2018-05-09 14:55:36 +02:00
chriseth
be54f48197 Further refactor. 2018-05-09 11:48:21 +02:00
chriseth
86b7adc18f Refactor expression parser. 2018-05-09 11:48:21 +02:00
Alex Beregszaszi
ed9f80690b Simplify expectIdentifierToken by using expectToken 2018-05-03 22:10:51 +01:00
Alex Beregszaszi
73c99d15cd Remove useless helper expectAssignmentOperator in parser 2018-05-03 21:35:38 +01:00
chriseth
d44fb03322 Refactor parser. 2018-04-26 10:59:02 +02:00
Daniel Kirchner
e2dac9ed39 Set header.isConstructor for old style constructors in parseFunctionHeader as well. 2018-04-03 18:21:55 +02:00
Daniel Kirchner
d664a599e6 Constructors are defined using the `constructor` keyword. 2018-04-03 18:21:55 +02:00
chriseth
388718b59f Introduce emit statement. 2018-02-22 15:17:30 +01:00