Refactor classes representing individual characters & character classes
This commit is contained in:
parent
8dec6c90f4
commit
9667b3fd6c
17 changed files with 167 additions and 120 deletions
23
src/compiler/rules/character.h
Normal file
23
src/compiler/rules/character.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef __tree_sitter__char__
|
||||
#define __tree_sitter__char__
|
||||
|
||||
#include "rule.h"
|
||||
#include "char_match.h"
|
||||
|
||||
namespace tree_sitter {
|
||||
namespace rules {
|
||||
class Character : public Rule {
|
||||
public:
|
||||
Character(char character);
|
||||
Character(CharClass character_class);
|
||||
Character(char min_character, char max_character);
|
||||
bool operator==(const Rule& other) const;
|
||||
std::string to_string() const;
|
||||
void accept(Visitor &visitor) const;
|
||||
|
||||
const CharMatch value;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue