tree-sitter-solidity
Advanced tools
Comparing version 1.0.1 to 1.0.2
211
grammar.js
@@ -47,7 +47,7 @@ // Precedence is used by the parser to determine which rule to apply when there are two rules that can be applied. | ||
conflicts: $ => [ | ||
[$.primary_expression, $.type_name], | ||
[$._primary_expression, $.type_name], | ||
[$._parameter_list, $.fallback_receive_definition], | ||
[$.primary_expression, $.type_cast_expression], | ||
[$.yul_expression, $.yul_path], | ||
[$.yul_expression, $.yul_assignment], | ||
[$._primary_expression, $.type_cast_expression], | ||
[$._yul_expression, $.yul_path], | ||
[$._yul_expression, $.yul_assignment], | ||
], | ||
@@ -153,3 +153,3 @@ | ||
field("name", $.identifier), | ||
optional($.class_heritage), | ||
optional($._class_heritage), | ||
field('body', $.contract_body), | ||
@@ -161,3 +161,3 @@ ), | ||
field("name", $.identifier), | ||
optional($.class_heritage), | ||
optional($._class_heritage), | ||
field('body', $.contract_body), | ||
@@ -172,7 +172,8 @@ ), | ||
class_heritage: $ => seq( | ||
"is", commaSep1($._inheritance_specifier) | ||
_class_heritage: $ => seq( | ||
"is", | ||
commaSep1($.inheritance_specifier) | ||
), | ||
_inheritance_specifier: $ => seq( | ||
inheritance_specifier: $ => seq( | ||
field("ancestor", $._user_defined_type), | ||
@@ -200,3 +201,3 @@ optional(field("ancestor_arguments", $._call_arguments)), | ||
'struct', | ||
$.identifier, | ||
field("struct_name", $.identifier), | ||
'{', | ||
@@ -208,4 +209,4 @@ repeat1($.struct_member), | ||
struct_member: $ => seq( | ||
$.type_name, | ||
$.identifier, | ||
field("type", $.type_name), | ||
field("name", $.identifier), | ||
$._semicolon | ||
@@ -218,3 +219,3 @@ ), | ||
'{', | ||
commaSep(field("enum_value", $.identifier)), | ||
commaSep(alias($.identifier, $.enum_value)), | ||
'}', | ||
@@ -230,18 +231,22 @@ ), | ||
"(", | ||
commaSep(seq( | ||
field("type", $.type_name), | ||
optional("indexed"), | ||
optional(field("name", $.identifier)), | ||
)), | ||
commaSep($.event_paramater), | ||
")" | ||
), | ||
event_paramater: $ => seq( | ||
field("type", $.type_name), | ||
optional("indexed"), | ||
optional(field("name", $.identifier)), | ||
), | ||
using_directive: $ => seq( | ||
'using', | ||
field("alias", $._user_defined_type), | ||
alias($._user_defined_type, $.type_alias), | ||
'for', | ||
field("source", choice('*', $.type_name)), | ||
field("source", choice($.any_source_type, $.type_name)), | ||
$._semicolon | ||
), | ||
any_source_type: $ => '*', | ||
// -- [ Statements ] -- | ||
@@ -268,7 +273,8 @@ _statement: $ => choice( | ||
"{", | ||
repeat($.yul_statement), | ||
repeat($._yul_statement), | ||
"}" | ||
), | ||
yul_statement: $ => choice( | ||
// -- [ Yul ] -- | ||
_yul_statement: $ => choice( | ||
$.yul_block, | ||
@@ -281,8 +287,64 @@ $.yul_variable_declaration, | ||
$.yul_switch_statement, | ||
"leave", | ||
"break", | ||
"continue", | ||
$.yul_leave, | ||
$.yul_break, | ||
$.yul_continue, | ||
$.yul_function_definition | ||
), | ||
yul_leave: $ => "leave", | ||
yul_break: $ => "break", | ||
yul_continue: $ => "continue", | ||
yul_identifier: $ => /[a-zA-Z$_]+/, | ||
_yul_expression: $ => choice($.yul_path, $.yul_function_call, $._yul_literal), | ||
yul_path: $ => prec.left(dotSep1($.yul_identifier)), | ||
// -- Yul Literals -- | ||
_yul_literal: $ => choice( | ||
$.yul_decimal_number, | ||
$.yul_string_literal, | ||
$.yul_hex_number, | ||
$.yul_boolean, | ||
), | ||
yul_decimal_number: $ => /0|([1-9][0-9]*)/, | ||
yul_string_literal: $ => $.string, | ||
yul_hex_number: $ => /0x[0-9A-Fa-f]*/, | ||
yul_boolean: $ => choice('true', 'false'), | ||
// -- Yul Statements -- | ||
yul_block: $ => seq('{', repeat($._yul_statement), '}'), | ||
yul_variable_declaration: $ => prec.left(PREC.DECLARATION, choice( | ||
seq('let', field("left", $.yul_identifier), optional(seq(':=', field("right", $._yul_expression)))), | ||
seq( | ||
'let', field("left", choice( | ||
commaSep1($.yul_identifier), | ||
seq('(', commaSep1($.yul_identifier), ')') | ||
)), | ||
optional(seq(':=', field("right", $.yul_function_call)))), | ||
)), | ||
yul_assignment: $ => prec.left(PREC.ASSIGN, choice( | ||
seq($.yul_path, ':=', $._yul_expression), | ||
seq(commaSep1($.yul_path), optional(seq(':=', $.yul_function_call))), | ||
)), | ||
yul_function_call: $ => seq( | ||
field("function", choice($.yul_identifier, $.yul_evm_builtin)), '(', commaSep($._yul_expression), ')' | ||
), | ||
yul_if_statement: $ => seq('if', $._yul_expression, $.yul_block), | ||
yul_for_statement: $ => seq('for', $.yul_block, $._yul_expression, $.yul_block, $.yul_block), | ||
yul_switch_statement: $ => seq( | ||
'switch', $._yul_expression, | ||
choice( | ||
seq('default', $.yul_block), | ||
seq( | ||
repeat1(seq('case', $._yul_literal, $.yul_block)), | ||
optional(seq('default', $.yul_block)), | ||
) | ||
), | ||
), | ||
yul_function_definition: $ => seq( | ||
'function', $.yul_identifier, '(', commaSep($.yul_identifier), ')', | ||
optional(seq('->', commaSep1($.yul_identifier))), | ||
$.yul_block | ||
), | ||
yul_evm_builtin: $ => prec(1, choice( | ||
@@ -363,54 +425,3 @@ 'stop', | ||
yul_identifier: $ => $.identifier, | ||
yul_expression: $ => choice($.yul_path, $.yul_function_call, $.yul_literal), | ||
yul_path: $ => prec.left(dotSep1($.yul_identifier)), | ||
yul_literal: $ => choice( | ||
$.yul_decimal_number, | ||
$.yul_string_literal, | ||
$.yul_hex_number, | ||
$.yul_boolean, | ||
), | ||
yul_decimal_number: $ => /0|([1-9][0-9]*)/, | ||
yul_string_literal: $ => $.string, | ||
yul_hex_number: $ => /0x[0-9A-Fa-f]*/, | ||
yul_boolean: $ => choice('true', 'false'), | ||
yul_block: $ => seq('{', repeat($.yul_statement), '}'), | ||
yul_variable_declaration: $ => prec.left(PREC.DECLARATION, choice( | ||
seq('let', $.yul_identifier, optional(seq(':=', $.yul_expression))), | ||
seq( | ||
'let', | ||
choice( | ||
commaSep1($.yul_identifier), | ||
seq('(', commaSep1($.yul_identifier), ')') | ||
), | ||
optional(seq(':=', $.yul_function_call))), | ||
)), | ||
yul_assignment: $ => prec.left(PREC.ASSIGN, choice( | ||
seq($.yul_path, ':=', $.yul_expression), | ||
seq(commaSep1($.yul_path), optional(seq(':=', $.yul_function_call))), | ||
)), | ||
yul_function_call: $ => seq( | ||
choice($.yul_identifier, $.yul_evm_builtin), '(', commaSep($.yul_expression), ')' | ||
), | ||
yul_if_statement: $ => seq('if', $.yul_expression, $.yul_block), | ||
yul_for_statement: $ => seq('for', $.yul_block, $.yul_expression, $.yul_block, $.yul_block), | ||
yul_switch_statement: $ => seq( | ||
'switch', $.yul_expression, | ||
choice( | ||
seq('default', $.yul_block), | ||
seq( | ||
repeat1(seq('case', $.yul_literal, $.yul_block)), | ||
optional(seq('default', $.yul_block)), | ||
) | ||
), | ||
), | ||
yul_function_definition: $ => seq( | ||
'function', $.yul_identifier, '(', commaSep($.yul_identifier), ')', | ||
optional(seq('->', commaSep1($.yul_identifier))), | ||
$.yul_block | ||
), | ||
// -- [ Statements ] -- | ||
block_statement: $ => seq('{', repeat($._statement), "}"), | ||
@@ -423,3 +434,3 @@ variable_declaration_statement: $ => prec(3,seq( | ||
$._semicolon | ||
)), | ||
)), | ||
@@ -641,3 +652,3 @@ // var_variable_decartion: $ => prec.left(seq( | ||
$.meta_type_expression, | ||
$.primary_expression, | ||
$._primary_expression, | ||
$.struct_expression, | ||
@@ -649,3 +660,3 @@ $.ternary_expression, | ||
// TODO: make primary expression anonymous | ||
primary_expression: $ => choice( | ||
_primary_expression: $ => choice( | ||
$.parenthesized_expression, | ||
@@ -662,3 +673,3 @@ $.member_expression, | ||
$.identifier, | ||
$.literal, | ||
$._literal, | ||
$.new_expression, | ||
@@ -907,3 +918,4 @@ ), | ||
number: $ => /\d+/, | ||
literal: $ => choice( | ||
_literal: $ => choice( | ||
$.string_literal, | ||
@@ -917,8 +929,8 @@ $.number_literal, | ||
string_literal: $ => prec.left(repeat1($.string)), | ||
number_literal: $ => seq(choice($.decimal_number, $.hex_number), optional($.number_unit)), | ||
decimal_number: $ => choice( | ||
number_literal: $ => seq(choice($._decimal_number, $._hex_number), optional($.number_unit)), | ||
_decimal_number: $ => choice( | ||
/\d+(\.\d+)?([eE](-)?\d+)?/, | ||
/\.\d+([eE](-)?\d+)?/, | ||
), | ||
hex_number: $ => seq(/0[xX]/, optional(optionalDashSeparation($._hex_digit))), | ||
_hex_number: $ => seq(/0[xX]/, optional(optionalDashSeparation($._hex_digit))), | ||
_hex_digit: $ => /([a-fA-F0-9][a-fA-F0-9])/, | ||
@@ -928,3 +940,5 @@ number_unit: $ => choice( | ||
), | ||
boolean_literal: $ => choice('true', 'false'), | ||
true: $ => "true", | ||
false: $ => "false", | ||
boolean_literal: $ => choice($.true, $.false), | ||
hex_string_literal: $ => prec.left(repeat1(seq( | ||
@@ -942,2 +956,12 @@ 'hex', | ||
)), | ||
_escape_sequence: $ => token.immediate(seq( | ||
'\\', | ||
choice( | ||
/[^xu0-7]/, | ||
/[0-7]{1,3}/, | ||
/x[0-9a-fA-F]{2}/, | ||
/u[0-9a-fA-F]{4}/, | ||
/u{[0-9a-fA-F]+}/ | ||
) | ||
)), | ||
_single_quoted_unicode_char: $ => choice(/[^'\r\n\\]/, $._escape_sequence), | ||
@@ -957,3 +981,3 @@ _double_quoted_unicode_char: $ => choice(/[^"\r\n\\]/, $._escape_sequence), | ||
token.immediate(prec(PREC.STRING, /[^"\\\n]+|\\\r?\n/)), | ||
$.escape_sequence | ||
$._escape_sequence | ||
)), | ||
@@ -966,3 +990,3 @@ '"' | ||
token.immediate(prec(PREC.STRING, /[^'\\\n]+|\\\r?\n/)), | ||
$.escape_sequence | ||
$._escape_sequence | ||
)), | ||
@@ -972,12 +996,3 @@ "'" | ||
), | ||
escape_sequence: $ => token.immediate(seq( | ||
'\\', | ||
choice( | ||
/[^xu0-7]/, | ||
/[0-7]{1,3}/, | ||
/x[0-9a-fA-F]{2}/, | ||
/u[0-9a-fA-F]{4}/, | ||
/u{[0-9a-fA-F]+}/ | ||
) | ||
)), | ||
@@ -984,0 +999,0 @@ comment: $ => token( |
{ | ||
"name": "tree-sitter-solidity", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A tree sitter parser for Solidity", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,3 +39,3 @@ ==================== | ||
name: (identifier) | ||
(class_heritage ancestor: (identifier)) | ||
(inheritance_specifier ancestor: (identifier)) | ||
body: (contract_body))) | ||
@@ -54,3 +54,3 @@ | ||
name: (identifier) | ||
(class_heritage ancestor: (identifier)) | ||
(inheritance_specifier ancestor: (identifier)) | ||
body: (contract_body))) | ||
@@ -69,6 +69,5 @@ | ||
name: (identifier) | ||
(class_heritage | ||
ancestor: (identifier) | ||
ancestor: (identifier) | ||
ancestor_arguments: (primary_expression (literal (number_literal (decimal_number))))) | ||
body: (contract_body))) | ||
(inheritance_specifier ancestor: (identifier)) | ||
(inheritance_specifier ancestor: (identifier) | ||
ancestor_arguments: (number_literal)) | ||
body: (contract_body))) |
@@ -15,4 +15,4 @@ ==================== | ||
enum_type_name: (identifier) | ||
enum_value: (identifier ) | ||
enum_value: (identifier ))) | ||
(enum_value) | ||
(enum_value))) | ||
@@ -32,2 +32,2 @@ | ||
enum_type_name: (identifier) | ||
enum_value: (identifier ))) | ||
(enum_value))) |
@@ -52,3 +52,3 @@ ==================== | ||
name: (identifier) | ||
type: (type_name))))) | ||
(event_paramater type: (type_name)))))) | ||
@@ -72,10 +72,12 @@ ==================== | ||
type: (type_name) | ||
(event_paramater type: (type_name)) | ||
type: (type_name) | ||
name: (identifier) | ||
(event_paramater | ||
type: (type_name) | ||
name: (identifier)) | ||
type: (type_name) | ||
(event_paramater type: (type_name)) | ||
type: (type_name) | ||
name: (identifier))))) | ||
(event_paramater | ||
type: (type_name) | ||
name: (identifier)))))) |
@@ -22,4 +22,3 @@ ==================== | ||
(variable_declaration_statement (variable_declaration (type_name) name: (identifier))) | ||
(expression_statement | ||
(primary_expression (member_expression object: (identifier) property: (property_identifier))))))))) | ||
(expression_statement (member_expression object: (identifier) property: (property_identifier)))))))) | ||
@@ -45,4 +44,3 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression (array_access base: (primary_expression (identifier)) index: (primary_expression (literal (number_literal (decimal_number)))))))))))) | ||
(expression_statement (array_access base: (identifier) index: (number_literal )))))))) | ||
@@ -68,5 +66,4 @@ ==================== | ||
body: (function_body | ||
(expression_statement (primary_expression | ||
(parenthesized_expression (primary_expression | ||
(literal (number_literal (decimal_number)))))))))))) | ||
(expression_statement | ||
(parenthesized_expression (number_literal)))))))) | ||
@@ -96,7 +93,7 @@ ==================== | ||
body: (function_body | ||
(expression_statement (binary_expression left: (primary_expression (literal (number_literal (decimal_number)))) right: (primary_expression (literal (number_literal (decimal_number)))))) | ||
(expression_statement (update_expression argument: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier))))))))) | ||
(expression_statement (binary_expression left: (number_literal) right: (number_literal))) | ||
(expression_statement (update_expression argument: (identifier))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier)))))))) | ||
@@ -125,5 +122,5 @@ | ||
(struct_expression | ||
(primary_expression (identifier)) | ||
(identifier) | ||
(primary_expression (identifier))))))))) | ||
(identifier) | ||
(identifier)))))))) | ||
@@ -152,3 +149,3 @@ | ||
(identifier) | ||
(primary_expression (identifier))))))))) | ||
(identifier)))))))) | ||
@@ -176,3 +173,3 @@ ==================== | ||
(payable_conversion_expression | ||
(primary_expression (identifier))))))))) | ||
(identifier)))))))) | ||
@@ -199,5 +196,6 @@ ==================== | ||
function_name: (identifier) | ||
body: (function_body (expression_statement | ||
(update_expression argument: (primary_expression (identifier)))) | ||
(expression_statement (unary_expression argument: (primary_expression (identifier))))))))) | ||
body: (function_body | ||
(expression_statement | ||
(update_expression argument: (identifier))) | ||
(expression_statement (unary_expression argument: (identifier)))))))) | ||
@@ -231,8 +229,8 @@ | ||
body: (function_body | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier))) | ||
(comment) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier)))) | ||
(expression_statement (binary_expression left: (primary_expression (identifier)) right: (primary_expression (identifier))))))))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier))) | ||
(expression_statement (binary_expression left: (identifier) right: (identifier)))))))) | ||
@@ -259,8 +257,8 @@ | ||
(contract_body (function_definition (identifier) (function_body | ||
(expression_statement (binary_expression (primary_expression (identifier)) (primary_expression (identifier)))) | ||
(expression_statement (binary_expression (primary_expression (identifier)) (primary_expression (identifier)))) | ||
(expression_statement (binary_expression (primary_expression (identifier)) (primary_expression (identifier)))) | ||
(expression_statement (binary_expression (primary_expression (identifier)) (primary_expression (identifier)))) | ||
(expression_statement (binary_expression (primary_expression (identifier)) (primary_expression (identifier)))) | ||
(expression_statement (binary_expression (primary_expression (identifier)) (primary_expression (identifier))))))))) | ||
(expression_statement (binary_expression (identifier) (identifier))) | ||
(expression_statement (binary_expression (identifier) (identifier))) | ||
(expression_statement (binary_expression (identifier) (identifier))) | ||
(expression_statement (binary_expression (identifier) (identifier))) | ||
(expression_statement (binary_expression (identifier) (identifier))) | ||
(expression_statement (binary_expression (identifier) (identifier)))))))) | ||
@@ -284,7 +282,7 @@ | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(expression_statement (primary_expression (assignment_expression (identifier) (primary_expression (identifier))))) | ||
(expression_statement (primary_expression (augmented_assignment_expression (identifier) (primary_expression (identifier))))) | ||
(expression_statement (primary_expression (augmented_assignment_expression (identifier) (primary_expression (identifier))))) | ||
(expression_statement (primary_expression (augmented_assignment_expression (identifier) (primary_expression (identifier))))) | ||
(expression_statement (primary_expression (augmented_assignment_expression (identifier) (primary_expression (identifier)))))))))) | ||
(expression_statement (assignment_expression (identifier) (identifier))) | ||
(expression_statement (augmented_assignment_expression (identifier) (identifier))) | ||
(expression_statement (augmented_assignment_expression (identifier) (identifier))) | ||
(expression_statement (augmented_assignment_expression (identifier) (identifier))) | ||
(expression_statement (augmented_assignment_expression (identifier) (identifier)))))))) | ||
@@ -308,7 +306,7 @@ | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(expression_statement (primary_expression (tuple_expression (primary_expression (identifier)) (primary_expression (identifier))))) | ||
(expression_statement (primary_expression (inline_array_expression (primary_expression (literal (number_literal (decimal_number)))) (primary_expression (literal (number_literal (decimal_number))))))) | ||
(expression_statement (primary_expression (identifier))) | ||
(expression_statement (primary_expression (literal (number_literal (decimal_number))))) | ||
(expression_statement (primary_expression (member_expression (identifier) (property_identifier)))) (expression_statement (primary_expression))))))) | ||
(expression_statement (tuple_expression (identifier) (identifier))) | ||
(expression_statement (inline_array_expression (number_literal) (number_literal))) | ||
(expression_statement (identifier)) | ||
(expression_statement (number_literal)) | ||
(expression_statement (member_expression (identifier) (property_identifier))) (expression_statement)))))) | ||
@@ -327,3 +325,3 @@ | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(expression_statement (primary_expression (new_expression (type_name (identifier)))))))))) | ||
(expression_statement (new_expression (type_name (identifier))))))))) | ||
@@ -341,3 +339,3 @@ ==================== | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(expression_statement (ternary_expression (primary_expression (identifier)) (primary_expression (identifier)) (primary_expression (identifier))))))))) | ||
(expression_statement (ternary_expression (identifier) (identifier) (identifier)))))))) | ||
@@ -356,3 +354,2 @@ ==================== | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(expression_statement (type_cast_expression | ||
(primary_expression (literal (number_literal (decimal_number))))))))))) | ||
(expression_statement (type_cast_expression (number_literal )))))))) |
@@ -27,3 +27,3 @@ ==================== | ||
name: (identifier) | ||
(class_heritage ancestor: (identifier)) | ||
(inheritance_specifier ancestor: (identifier)) | ||
body: (contract_body))) | ||
@@ -42,7 +42,6 @@ | ||
name: (identifier) | ||
(class_heritage | ||
ancestor: (identifier) | ||
ancestor: (identifier) | ||
ancestor_arguments: (primary_expression | ||
(literal (number_literal (decimal_number))))) | ||
(inheritance_specifier ancestor: (identifier)) | ||
(inheritance_specifier | ||
ancestor: (identifier) | ||
ancestor_arguments: (number_literal)) | ||
body: (contract_body))) |
@@ -20,7 +20,3 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression | ||
(literal | ||
(number_literal | ||
(decimal_number)))))))))) | ||
(expression_statement (number_literal))))))) | ||
@@ -46,7 +42,3 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression | ||
(literal | ||
(string_literal | ||
(string)))))))))) | ||
(expression_statement (string_literal (string)))))))) | ||
@@ -72,6 +64,4 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression | ||
(literal | ||
(string_literal (string) (string)))))))))) | ||
(expression_statement (string_literal (string) (string)))))))) | ||
==================== | ||
@@ -99,10 +89,6 @@ String Literal Escapes | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression (literal (string_literal (string))))) | ||
(expression_statement | ||
(primary_expression (literal (string_literal (string (escape_sequence)))))) | ||
(expression_statement | ||
(primary_expression (literal (string_literal (string))))) | ||
(expression_statement | ||
(primary_expression (literal (string_literal (string)))))))))) | ||
(expression_statement (string_literal (string))) | ||
(expression_statement (string_literal (string))) | ||
(expression_statement (string_literal (string))) | ||
(expression_statement (string_literal (string)))))))) | ||
@@ -129,6 +115,4 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression (literal (hex_string_literal)))) | ||
(expression_statement | ||
(primary_expression (literal (hex_string_literal))))))))) | ||
(expression_statement (hex_string_literal)) | ||
(expression_statement (hex_string_literal))))))) | ||
@@ -155,6 +139,4 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression (literal (unicode_string_literal)))) | ||
(expression_statement | ||
(primary_expression (literal (unicode_string_literal))))))))) | ||
(expression_statement (unicode_string_literal)) | ||
(expression_statement (unicode_string_literal))))))) | ||
@@ -181,8 +163,6 @@ ==================== | ||
body: (function_body | ||
(expression_statement | ||
(primary_expression (literal (boolean_literal)))) | ||
(expression_statement | ||
(primary_expression (literal (boolean_literal))))))))) | ||
(expression_statement (boolean_literal (true))) | ||
(expression_statement (boolean_literal (false)))))))) | ||
@@ -36,4 +36,3 @@ ==================== | ||
name: (identifier) | ||
value: (primary_expression | ||
(literal (number_literal (decimal_number)))))))) | ||
value: (number_literal))))) | ||
@@ -58,3 +57,2 @@ ==================== | ||
name: (identifier) | ||
value: (primary_expression | ||
(literal (number_literal (decimal_number)))))))) | ||
value: (number_literal))))) |
@@ -39,3 +39,3 @@ ==================== | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) | ||
(function_body (block_statement (expression_statement (primary_expression (literal (number_literal (decimal_number))))))))))) | ||
(function_body (block_statement (expression_statement (number_literal)))))))) | ||
@@ -62,5 +62,5 @@ ==================== | ||
(function_body | ||
(if_statement (primary_expression (identifier)) (block_statement)) | ||
(if_statement (primary_expression (identifier)) (block_statement) (block_statement (expression_statement (primary_expression (identifier))))) | ||
(if_statement (primary_expression (identifier)) (expression_statement (primary_expression (literal (number_literal (decimal_number))))))))))) | ||
(if_statement (identifier) (block_statement)) | ||
(if_statement (identifier) (block_statement) (block_statement (expression_statement (identifier)))) | ||
(if_statement (identifier) (expression_statement (number_literal)))))))) | ||
@@ -82,7 +82,17 @@ ==================== | ||
(function_body | ||
(for_statement (variable_declaration_statement (variable_declaration (type_name) (identifier)) (primary_expression (literal (number_literal (decimal_number))))) (expression_statement (update_expression (primary_expression (identifier)))) (binary_expression (primary_expression (identifier)) (primary_expression (literal (number_literal (decimal_number))))) (expression_statement (update_expression (primary_expression (identifier))))) | ||
(for_statement (expression_statement (update_expression (primary_expression (identifier)))) (binary_expression (primary_expression (identifier)) (primary_expression (literal (number_literal (decimal_number))))) (expression_statement (update_expression (primary_expression (identifier))))) | ||
(for_statement (binary_expression (primary_expression (identifier)) (primary_expression (literal (number_literal (decimal_number))))) (expression_statement (update_expression (primary_expression (identifier)))))))))) | ||
(for_statement | ||
(variable_declaration_statement (variable_declaration (type_name) (identifier)) (number_literal)) | ||
(expression_statement (update_expression (identifier))) | ||
(binary_expression (identifier) (number_literal)) | ||
(expression_statement (update_expression (identifier)))) | ||
(for_statement | ||
(expression_statement (update_expression (identifier))) | ||
(binary_expression (identifier) (number_literal)) | ||
(expression_statement (update_expression (identifier)))) | ||
(for_statement | ||
(binary_expression (identifier) (number_literal)) | ||
(expression_statement (update_expression (identifier))))))))) | ||
==================== | ||
@@ -100,7 +110,7 @@ While statement | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(while_statement (primary_expression (literal (boolean_literal))) (return_statement))))))) | ||
(while_statement (boolean_literal (true)) (return_statement))))))) | ||
==================== | ||
While statement | ||
While statement 2 | ||
==================== | ||
@@ -119,3 +129,3 @@ | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(while_statement (primary_expression (literal (boolean_literal))) (block_statement (break_statement) (continue_statement)))))))) | ||
(while_statement (boolean_literal (true)) (block_statement (break_statement) (continue_statement)))))))) | ||
@@ -139,4 +149,4 @@ | ||
(source_file (contract_declaration (identifier) (contract_body (function_definition (identifier) (function_body | ||
(try_statement (call_expresion (identifier)) (type_name) (identifier) (block_statement (expression_statement (update_expression (primary_expression (identifier))))) | ||
(catch_clause (identifier) (type_name) (identifier) (block_statement (expression_statement (update_expression (primary_expression (identifier)))))))))))) | ||
(try_statement (call_expresion (identifier)) (type_name) (identifier) (block_statement (expression_statement (update_expression (identifier)))) | ||
(catch_clause (identifier) (type_name) (identifier) (block_statement (expression_statement (update_expression (identifier))))))))))) | ||
@@ -168,3 +178,3 @@ ==================== | ||
(source_file (contract_declaration (identifier) (contract_body | ||
(function_definition (identifier) (function_body (emit_statement (primary_expression (identifier)))))))) | ||
(function_definition (identifier) (function_body (emit_statement (identifier))))))) | ||
@@ -171,0 +181,0 @@ |
@@ -16,5 +16,4 @@ ==================== | ||
(using_directive | ||
alias: (identifier) | ||
alias: (identifier))))) | ||
(type_alias (identifier) (identifier)) | ||
source: (any_source_type))))) | ||
==================== | ||
@@ -34,5 +33,4 @@ Using directive | ||
body: (contract_body | ||
(using_directive | ||
alias: (identifier) | ||
alias: (identifier) | ||
source: (type_name))))) | ||
(using_directive | ||
(type_alias (identifier) (identifier)) | ||
source: (type_name))))) |
@@ -16,5 +16,6 @@ ==================== | ||
(function_body (assembly_statement | ||
(yul_statement (yul_function_call (yul_evm_builtin) | ||
(yul_expression (yul_literal (yul_hex_number))) | ||
(yul_expression (yul_literal (yul_hex_number))))))))))) | ||
(yul_function_call | ||
(yul_evm_builtin) | ||
(yul_hex_number) | ||
(yul_hex_number)))))))) | ||
==================== | ||
@@ -38,6 +39,7 @@ Assembly switch | ||
(function_body (assembly_statement | ||
(yul_statement (yul_switch_statement | ||
(yul_expression (yul_path (yul_identifier (identifier)))) (yul_literal (yul_decimal_number)) | ||
(yul_block (yul_statement (yul_function_call (yul_evm_builtin) | ||
(yul_expression (yul_path (yul_identifier (identifier))))))))))))))) | ||
(yul_switch_statement | ||
(yul_path (yul_identifier)) | ||
(yul_decimal_number) | ||
(yul_block | ||
(yul_function_call (yul_evm_builtin) (yul_path (yul_identifier))))))))))) | ||
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
1502139
37
962
1
1