Merge pull request #204 from tree-sitter/property-sheets
Add a system for assigning properties to syntax nodes
This commit is contained in:
commit
fa1f4aa86a
22 changed files with 924 additions and 103 deletions
|
|
@ -181,7 +181,7 @@ describe("extract_tokens", []() {
|
|||
Seq{CharacterSet{{'a'}}, CharacterSet{{'b'}}},
|
||||
true
|
||||
},
|
||||
}))
|
||||
}));
|
||||
});
|
||||
|
||||
it("does not move entire rules into the lexical grammar if their content is used elsewhere in the grammar", [&]() {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ describe("intern_symbols", []() {
|
|||
VariableTypeNamed,
|
||||
Symbol::non_terminal(2),
|
||||
},
|
||||
}))
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
11
test/fixtures/error_corpus/javascript_errors.txt
vendored
11
test/fixtures/error_corpus/javascript_errors.txt
vendored
|
|
@ -138,7 +138,8 @@ var x = !!!
|
|||
Errors inside of a template string substitution
|
||||
=========================================================
|
||||
|
||||
const a = `b c ${d +} f g`
|
||||
const a = `b c ${d += } f g`
|
||||
const h = `i ${j(k} l`
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -146,7 +147,13 @@ const a = `b c ${d +} f g`
|
|||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(template_string (template_substitution (identifier) (ERROR))))))
|
||||
(template_string (template_substitution (identifier) (ERROR)))))
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(template_string (template_substitution (call_expression
|
||||
(identifier)
|
||||
(arguments (identifier) (MISSING))))))))
|
||||
|
||||
=========================================================
|
||||
Long sequences of invalid tokens
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
using std::string;
|
||||
using std::cout;
|
||||
using namespace snowhouse;
|
||||
|
||||
static void append_text_to_scope_sequence(ScopeSequence *sequence,
|
||||
ScopeStack *current_scopes,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "helpers/tree_helpers.h"
|
||||
#include "helpers/point_helpers.h"
|
||||
#include <ostream>
|
||||
#include <cstring>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ describe("Node", [&]() {
|
|||
AssertThat(ts_node_start_point(child7), Equals<TSPoint>({ 8, 0 }));
|
||||
AssertThat(ts_node_end_point(child7), Equals<TSPoint>({ 8, 1 }));
|
||||
|
||||
AssertThat(ts_node_child_count(child6), Equals<size_t>(3))
|
||||
AssertThat(ts_node_child_count(child6), Equals<size_t>(3));
|
||||
|
||||
TSNode left_brace = ts_node_child(child6, 0);
|
||||
TSNode pair = ts_node_child(child6, 1);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ namespace tree_sitter {}
|
|||
|
||||
using namespace std;
|
||||
using namespace bandit;
|
||||
using namespace snowhouse;
|
||||
using namespace tree_sitter;
|
||||
|
||||
#define START_TEST go_bandit([]() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue