Skip to content

Commit

Permalink
regenerate code
Browse files Browse the repository at this point in the history
  • Loading branch information
JoranHonig committed Feb 26, 2024
1 parent 82c8899 commit e49a18d
Show file tree
Hide file tree
Showing 6 changed files with 5,905 additions and 5,111 deletions.
2 changes: 1 addition & 1 deletion bindings/node/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void Init(Local<Object> exports, Local<Object> module) {
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_solidity());

Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("Solidity").ToLocalChecked());
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("solidity").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}

Expand Down
14 changes: 4 additions & 10 deletions bindings/rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
//! This crate provides Solidity language support for the [tree-sitter][] parsing library.
//!
//! The bindings in https:/tree-sitter/tree-sitter-javascript/blob/master/bindings/rust were used
//! as a template for the tree-sitter-solidity rust bindings.
//! This crate provides solidity language support for the [tree-sitter][] parsing library.
//!
//! Typically, you will use the [language][language func] function to add this language to a
//! tree-sitter [Parser][], and then use the parser to parse some code:
//!
//! ```
//! let code = "";
//! let mut parser = tree_sitter::Parser::new();
//! parser.set_language(tree_sitter_solidity::language()).expect("Error loading Solidity grammar");
//! parser.set_language(tree_sitter_solidity::language()).expect("Error loading solidity grammar");
//! let tree = parser.parse(code, None).unwrap();
//! ```
//!
Expand All @@ -31,17 +28,14 @@ pub fn language() -> Language {
unsafe { tree_sitter_solidity() }
}

/// The source of the Solidity tree-sitter grammar description.
pub const GRAMMAR: &'static str = include_str!("../../grammar.js");

/// The content of the [`node-types.json`][] file for this grammar.
///
/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types
pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json");

// Uncomment these to include any queries that this grammar contains

pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm");
// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm");
// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm");
Expand All @@ -53,6 +47,6 @@ mod tests {
let mut parser = tree_sitter::Parser::new();
parser
.set_language(super::language())
.expect("Error loading Solidity language");
.expect("Error loading solidity language");
}
}
45 changes: 18 additions & 27 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3011,7 +3011,7 @@
},
"revert_statement": {
"type": "PREC",
"value": 1,
"value": 14,
"content": {
"type": "SEQ",
"members": [
Expand Down Expand Up @@ -5456,21 +5456,25 @@
}
},
"call_expression": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "function",
"content": {
"type": "PREC_RIGHT",
"value": 12,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "function",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "SYMBOL",
"name": "_expression"
"name": "_call_arguments"
}
},
{
"type": "SYMBOL",
"name": "_call_arguments"
}
]
]
}
},
"payable_conversion_expression": {
"type": "SEQ",
Expand Down Expand Up @@ -6990,22 +6994,10 @@
"member_expression",
"_identifier_path"
],
[
"_call_arguments",
"tuple_expression"
],
[
"_parameter_list",
"fallback_receive_definition"
],
[
"_primary_expression",
"type_cast_expression"
],
[
"pragma_value",
"_solidity"
],
[
"variable_declaration_tuple",
"tuple_expression"
Expand All @@ -7028,4 +7020,3 @@
"inline": [],
"supertypes": []
}

Loading

0 comments on commit e49a18d

Please sign in to comment.