Skip to content

Commit

Permalink
fix: compilation with clang >=18
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Jun 18, 2024
1 parent 419da7d commit 8031a92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ TSNode UnmarshalNode(Napi::Env env, const Tree *tree) {
}

struct SymbolSet {
void add(TSSymbol symbol) { symbols += symbol; }
[[nodiscard]] bool contains(TSSymbol symbol) const { return symbols.find(symbol) != symbols.npos; }
void add(TSSymbol symbol) { symbols.push_back(symbol); }
[[nodiscard]] bool contains(TSSymbol symbol) const { return std::find(symbols.begin(), symbols.end(), symbol) != symbols.end(); }
private:
std::basic_string<TSSymbol> symbols;
std::vector<TSSymbol> symbols;
};

void symbol_set_from_js(SymbolSet *symbols, const Napi::Value &value, const TSLanguage *language) {
Expand Down

0 comments on commit 8031a92

Please sign in to comment.