OR-1 dataflow CPU sketch
at main 40 lines 1.3 kB view raw
1#ifndef NODE_TREE_SITTER_QUERY_H_ 2#define NODE_TREE_SITTER_QUERY_H_ 3 4#include "./addon_data.h" 5#include "tree_sitter/api.h" 6 7#include <napi.h> 8#include <node_object_wrap.h> 9 10namespace node_tree_sitter { 11 12class Query final : public Napi::ObjectWrap<Query> { 13 public: 14 static void Init(Napi::Env env, Napi::Object exports); 15 static Query *UnwrapQuery(const Napi::Value &); 16 17 explicit Query(const Napi::CallbackInfo &info); 18 ~Query() final; 19 20 private: 21 TSQuery *query_; 22 23 Napi::Value New(const Napi::CallbackInfo &); 24 Napi::Value Matches(const Napi::CallbackInfo &); 25 Napi::Value Captures(const Napi::CallbackInfo &); 26 Napi::Value GetPredicates(const Napi::CallbackInfo &); 27 Napi::Value DisableCapture(const Napi::CallbackInfo &); 28 Napi::Value DisablePattern(const Napi::CallbackInfo &); 29 Napi::Value IsPatternGuaranteedAtStep(const Napi::CallbackInfo &); 30 Napi::Value IsPatternRooted(const Napi::CallbackInfo &); 31 Napi::Value IsPatternNonLocal(const Napi::CallbackInfo &); 32 Napi::Value StartIndexForPattern(const Napi::CallbackInfo &); 33 Napi::Value EndIndexForPattern(const Napi::CallbackInfo &); 34 Napi::Value DidExceedMatchLimit(const Napi::CallbackInfo &); 35 Napi::Value MatchLimit(const Napi::CallbackInfo &); 36}; 37 38} // namespace node_tree_sitter 39 40#endif // NODE_TREE_SITTER_QUERY_H_