Merge pull request #204 from tree-sitter/property-sheets

Add a system for assigning properties to syntax nodes
This commit is contained in:
Max Brunsfeld 2018-10-15 23:18:33 -07:00 committed by GitHub
commit fa1f4aa86a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 924 additions and 103 deletions

View file

@ -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", [&]() {

View file

@ -84,7 +84,7 @@ describe("intern_symbols", []() {
VariableTypeNamed,
Symbol::non_terminal(2),
},
}))
}));
});
});

View file

@ -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

View file

@ -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,

View file

@ -2,6 +2,7 @@
#include "helpers/tree_helpers.h"
#include "helpers/point_helpers.h"
#include <ostream>
#include <cstring>
using std::string;
using std::vector;

View file

@ -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);

View file

@ -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([]() {