Expose all grammar compilation errors
This commit is contained in:
parent
e36d586817
commit
3a50171249
15 changed files with 79 additions and 49 deletions
|
|
@ -41,10 +41,24 @@ namespace tree_sitter {
|
|||
bool operator<(const Conflict &other) const;
|
||||
};
|
||||
|
||||
enum GrammarErrorType {
|
||||
GrammarErrorTypeRegex,
|
||||
GrammarErrorTypeUndefinedSymbol
|
||||
};
|
||||
|
||||
class GrammarError {
|
||||
public:
|
||||
GrammarError(GrammarErrorType type, std::string message);
|
||||
GrammarErrorType type;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream &stream, const Grammar &grammar);
|
||||
std::ostream& operator<<(std::ostream &stream, const Conflict &conflict);
|
||||
std::ostream& operator<<(std::ostream &stream, const GrammarError *error);
|
||||
|
||||
std::pair<std::string, std::vector<Conflict>> compile(const Grammar &grammar, std::string name);
|
||||
std::tuple<std::string, std::vector<Conflict>, const GrammarError *>
|
||||
compile(const Grammar &grammar, std::string name);
|
||||
}
|
||||
|
||||
#endif // TREE_SITTER_COMPILER_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue