Make some implicit constructors explicit
This commit is contained in:
parent
a4120f36d4
commit
504c361cb8
8 changed files with 9 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ namespace tree_sitter {
|
|||
using CanBeBlank::visit;
|
||||
|
||||
public:
|
||||
CanBeBlankRecursive(const PreparedGrammar &grammar) : grammar(grammar) {}
|
||||
explicit CanBeBlankRecursive(const PreparedGrammar &grammar) : grammar(grammar) {}
|
||||
|
||||
void visit(const rules::Symbol *rule) {
|
||||
value = grammar.has_definition(*rule) && apply(grammar.rule(*rule));
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ namespace tree_sitter {
|
|||
struct CharacterRange {
|
||||
char min;
|
||||
char max;
|
||||
// IMPLICIT_CONSTRUCTORS
|
||||
CharacterRange(char value);
|
||||
CharacterRange(char min, char max);
|
||||
bool operator==(const CharacterRange &other) const;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ namespace tree_sitter {
|
|||
class CharacterSet : public Rule {
|
||||
public:
|
||||
CharacterSet();
|
||||
CharacterSet(const std::set<CharacterRange> &ranges);
|
||||
CharacterSet(const std::initializer_list<CharacterRange> &ranges);
|
||||
explicit CharacterSet(const std::set<CharacterRange> &ranges);
|
||||
explicit CharacterSet(const std::initializer_list<CharacterRange> &ranges);
|
||||
|
||||
bool operator==(const Rule& other) const;
|
||||
bool operator<(const CharacterSet &) const;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace tree_sitter {
|
|||
|
||||
class PatternParser {
|
||||
public:
|
||||
PatternParser(const string &input) :
|
||||
explicit PatternParser(const string &input) :
|
||||
input(input),
|
||||
length(input.length()),
|
||||
position(0) {}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace tree_sitter {
|
|||
class Pattern : public Rule {
|
||||
const std::string value;
|
||||
public:
|
||||
Pattern(const std::string &string);
|
||||
explicit Pattern(const std::string &string);
|
||||
|
||||
bool operator==(const Rule& other) const;
|
||||
size_t hash_code() const;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace tree_sitter {
|
|||
namespace rules {
|
||||
class Repeat : public Rule {
|
||||
public:
|
||||
Repeat(rule_ptr content);
|
||||
explicit Repeat(rule_ptr content);
|
||||
|
||||
bool operator==(const Rule& other) const;
|
||||
size_t hash_code() const;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace tree_sitter {
|
|||
namespace rules {
|
||||
class String : public Rule {
|
||||
public:
|
||||
String(std::string value);
|
||||
explicit String(std::string value);
|
||||
|
||||
bool operator==(const Rule& other) const;
|
||||
size_t hash_code() const;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace tree_sitter {
|
|||
|
||||
class Symbol : public Rule {
|
||||
public:
|
||||
Symbol(const std::string &name);
|
||||
explicit Symbol(const std::string &name);
|
||||
Symbol(const std::string &name, SymbolType type);
|
||||
|
||||
bool operator==(const Rule& other) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue