Skip to content

Commit

Permalink
Merge pull request #3 from TimWhiting/master
Browse files Browse the repository at this point in the history
add in simple flutter example
  • Loading branch information
UserNobody14 authored Jul 10, 2020
2 parents 6b8552b + 2f457c2 commit 1340165
Show file tree
Hide file tree
Showing 6 changed files with 107,484 additions and 107,310 deletions.
107 changes: 58 additions & 49 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ module.exports = grammar({
[$._real_expression, $._below_relational_expression],
[$._postfix_expression, $.assignable_expression],
[$._postfix_expression],
[$._top_level_definition, $.getter_signature],
[$._top_level_definition, $.setter_signature],
[$._top_level_definition, $.lambda_expression]
// [$._expression_without_cascade, $._real_expression]
// [$.constructor_signature, $._formal_parameter_part],
// [$._unannotated_type, $.type_parameter],
Expand Down Expand Up @@ -267,57 +270,63 @@ module.exports = grammar({

// _library_definition: $ => ,

_top_level_definition: $ => choice(
$.class_definition,
$.enum_declaration,
// $.type_alias,
seq(
optional($._external_builtin),
$.function_signature,
$._semicolon
),
seq(
optional($._external_builtin),
$.getter_signature,
$._semicolon
),
seq(
optional($._external_builtin),
$.setter_signature,
$._semicolon
),
// seq(
// $.lambda_expression,
// $._semicolon
// ),
// type get
seq(
optional($._type),
$._get,
$.identifier,
$.function_body
),
seq(
optional($._type),
$._set,
$.identifier,
$.formal_parameter_list,
$.function_body
),
// type set
// final or const static final declaration list
seq(
choice(
$._final_builtin,
$._const_builtin
_top_level_definition: $ => prec.left(
choice(
$.class_definition,
$.enum_declaration,
// $.type_alias,
seq(
optional($._external_builtin),
$.function_signature,
$._semicolon
),
$._type,
$.static_final_declaration_list
seq(
optional($._external_builtin),
$.getter_signature,
$._semicolon
),
seq(
optional($._external_builtin),
$.setter_signature,
$._semicolon
),
// seq(
// $.lambda_expression,
// $._semicolon
// ),
// type get
seq(
$.function_signature,
$.function_body
),
seq(
optional($._type),
$._get,
$.identifier,
$.function_body
),
seq(
optional($._type),
$._set,
$.identifier,
$.formal_parameter_list,
$.function_body
),
// type set
// final or const static final declaration list
seq(
choice(
$._final_builtin,
$._const_builtin
),
$._type,
$.static_final_declaration_list
),
seq(
$.variable_declaration,
$._semicolon
)
),
seq(
$.variable_declaration,
$._semicolon
)
),

// Literalss
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
try {
module.exports = require("./build/Release/tree_sitter_java_binding");
module.exports = require("./build/Release/tree_sitter_dart_binding");
} catch (error) {
try {
module.exports = require("./build/Debug/tree_sitter_java_binding");
module.exports = require("./build/Debug/tree_sitter_dart_binding");
} catch (_) {
throw error
}
}

try {
module.exports.nodeTypeInfo = require("./src/node-types.json");
} catch (_) {}
} catch (_) {}
Loading

0 comments on commit 1340165

Please sign in to comment.