Make the compile function plain C and take a JSON grammar
This commit is contained in:
parent
b69e19c525
commit
d4632ab9a9
54 changed files with 325 additions and 234 deletions
28
src/compiler/compile_error.h
Normal file
28
src/compiler/compile_error.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef COMPILER_COMPILE_ERROR_H_
|
||||
#define COMPILER_COMPILE_ERROR_H_
|
||||
|
||||
#include <string>
|
||||
#include "tree_sitter/compiler.h"
|
||||
|
||||
namespace tree_sitter {
|
||||
|
||||
class CompileError {
|
||||
public:
|
||||
CompileError(TSCompileErrorType type, std::string message)
|
||||
: type(type), message(message) {}
|
||||
|
||||
static CompileError none() {
|
||||
return CompileError(TSCompileErrorTypeNone, "");
|
||||
}
|
||||
|
||||
bool operator==(const CompileError &other) const {
|
||||
return type == other.type && message == other.message;
|
||||
}
|
||||
|
||||
TSCompileErrorType type;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
} // namespace tree_sitter
|
||||
|
||||
#endif // COMPILER_COMPILE_ERROR_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue