➜ tree-sitter-elixir git:(main) gcc -o tmp/parser.so -I./src src/parser.c src/scanner.cc -shared -fPIC -std=c++98
cc1: warning: command-line option ‘-std=c++98’ is valid for C++/ObjC++ but not for C
src/scanner.cc: In function ‘bool {anonymous}::is_token_end(int32_t)’:
src/scanner.cc:110:33: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’
110 | for (const char& terminator : token_terminators) {
| ^~~~~~~~~~~~~~~~~
src/scanner.cc:110:33: error: forming reference to reference type ‘const char (&)[27]’
src/scanner.cc: In function ‘void* {anonymous}::tree_sitter_elixir_external_scanner_create()’:
src/scanner.cc:601:12: error: ‘nullptr’ was not declared in this scope
601 | return nullptr;
| ^~~~~~~
Closes #6.
Tested by explicitly compiling with
-std=c++98
.After the change, it compiles fine.