Skip to content

Commit fa4e753

Browse files
committed
Cleanup
Signed-off-by: Matthew Hayes <matthewha853@gmail.com>
1 parent 1e844c3 commit fa4e753

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

cactus-engine/src/engine.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ class GrammarVocabulary {
286286
class Grammar {
287287
public:
288288
Grammar();
289+
Grammar(xgrammar::Grammar raw_grammar);
289290
~Grammar() = default;
290291

291292
static Grammar ebnf(const std::string& ebnf, const std::string& start_symbol = "root");
@@ -316,9 +317,6 @@ class Grammar {
316317
const xgrammar::Grammar& raw_value() const;
317318

318319
private:
319-
friend class GrammarMatcher;
320-
Grammar(xgrammar::Grammar raw_grammar);
321-
322320
xgrammar::Grammar grammar;
323321
bool is_universal_ = false;
324322
};

cactus-engine/src/grammar.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,8 @@ Grammar Grammar::ebnf(const std::string& ebnf, const std::string& start_symbol)
8888
}
8989

9090
Grammar Grammar::epsilon() {
91-
return Grammar::structural_tag(R"({
92-
"type": "structural_tag",
93-
"format": {
94-
"type": "repeat",
95-
"min": 0,
96-
"max": 0,
97-
"content": {
98-
"type": "const_string",
99-
"value": "x"
100-
}
101-
}
102-
})");
91+
static auto grammar = Grammar::ebnf("root ::= \"\"");
92+
return grammar;
10393
}
10494

10595
Grammar Grammar::json() {

0 commit comments

Comments
 (0)