Make descriptions more consistent in compiler specs
This commit is contained in:
parent
8f109504a8
commit
e9dad529f5
11 changed files with 13 additions and 13 deletions
|
|
@ -9,7 +9,7 @@ using namespace build_tables;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("building parse tables", []() {
|
||||
describe("build_parse_table", []() {
|
||||
SyntaxGrammar parse_grammar({
|
||||
{ "rule0", choice({ i_sym(1), i_sym(2) }) },
|
||||
{ "rule1", i_token(0) },
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ describe("resolving parse conflicts", []() {
|
|||
{ "token3", keyword("stuff") },
|
||||
}, {}, {});
|
||||
|
||||
describe("lexical conflicts", [&]() {
|
||||
describe("LexConflictManager", [&]() {
|
||||
Symbol sym1(0, SymbolOptionToken);
|
||||
Symbol sym2(1, SymbolOptionToken);
|
||||
Symbol sym3(2, SymbolOptionToken);
|
||||
|
|
@ -79,7 +79,7 @@ describe("resolving parse conflicts", []() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("syntactic conflicts", [&]() {
|
||||
describe("ParseConflictManager", [&]() {
|
||||
Symbol sym1(0);
|
||||
Symbol sym2(1);
|
||||
ParseConflictManager *manager;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using namespace rules;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("computing FIRST sets", []() {
|
||||
describe("first_set", []() {
|
||||
const SyntaxGrammar null_grammar;
|
||||
|
||||
describe("for a sequence AB", [&]() {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using namespace build_tables;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("getting metadata for rules", []() {
|
||||
describe("get_metadata", []() {
|
||||
MetadataKey key1 = MetadataKey(100);
|
||||
MetadataKey key2 = MetadataKey(101);
|
||||
rule_ptr rule;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using namespace rules;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("computing closures of item sets", []() {
|
||||
describe("item_set_closure", []() {
|
||||
SyntaxGrammar grammar({
|
||||
{ "E", seq({
|
||||
i_sym(1),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using namespace build_tables;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("lexical item set transitions", []() {
|
||||
describe("char_transitions(LexItemSet)", []() {
|
||||
describe("when two items in the set have transitions on the same character", [&]() {
|
||||
it("merges the transitions by computing the union of the two item sets", [&]() {
|
||||
LexItemSet set1({
|
||||
|
|
@ -41,7 +41,7 @@ describe("lexical item set transitions", []() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("syntactic item set transitions", [&]() {
|
||||
describe("sym_transitions(ParseItemSet, SyntaxGrammar)", [&]() {
|
||||
SyntaxGrammar grammar({
|
||||
{ "A", blank() },
|
||||
{ "B", i_token(21) },
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using namespace build_tables;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("lex items", []() {
|
||||
describe("LexItem", []() {
|
||||
describe("determining if an item is the start of a token", [&]() {
|
||||
Symbol sym(1);
|
||||
rule_ptr token_start = make_shared<Metadata>(str("a"), map<MetadataKey, int>({
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using build_tables::rule_can_be_blank;
|
|||
|
||||
START_TEST
|
||||
|
||||
describe("checking if rules can be blank", [&]() {
|
||||
describe("rule_can_be_blank", [&]() {
|
||||
rule_ptr rule;
|
||||
|
||||
it("returns false for basic rules", [&]() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ START_TEST
|
|||
using namespace rules;
|
||||
using prepare_grammar::expand_tokens;
|
||||
|
||||
describe("expanding token rules", []() {
|
||||
describe("expand_tokens", []() {
|
||||
it("replaces regex patterns with their expansion", [&]() {
|
||||
LexicalGrammar grammar({
|
||||
{ "rule_A", seq({
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ describe("extract_tokens", []() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("handling ubiquitous tokens!", [&]() {
|
||||
describe("handling ubiquitous tokens", [&]() {
|
||||
describe("ubiquitous tokens that are not symbols", [&]() {
|
||||
it("adds them to the lexical grammar's separators", [&]() {
|
||||
auto result = extract_tokens(Grammar({
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ START_TEST
|
|||
using namespace rules;
|
||||
using prepare_grammar::intern_symbols;
|
||||
|
||||
describe("interning symbols in a grammar", []() {
|
||||
describe("intern_symbols", []() {
|
||||
it("replaces named symbols with numerically-indexed symbols", [&]() {
|
||||
Grammar grammar({
|
||||
{ "x", choice({ sym("y"), sym("z") }) },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue