Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add toml grammar #8

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@
[submodule "tree-sitter-gritql"]
path = vendor/tree-sitter-gritql
url = https://github.com/getgrit/tree-sitter-gritql.git
[submodule "resources/language-submodules/tree-sitter-toml"]
path = resources/language-submodules/tree-sitter-toml
url = https://github.com/ikatyang/tree-sitter-toml
Binary file modified crates/wasm-bindings/wasm_parsers/tree-sitter-go.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions resources/edit_grammars.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const allLanguages = [
'sql',
'typescript',
'yaml',
'toml'
];

// For these languages, copyMvGrammar is optional
Expand Down Expand Up @@ -166,6 +167,10 @@ async function buildLanguage(language) {
console.log(`[${language}] ` + message, ...args);
log(`Starting`);
const tsLangDir = `tree-sitter-${language}`;

if (language == 'toml') {
await execPromise(`cd ${tsLangDir} && npm install regexp-util && npx tree-sitter generate && cd ..`)
}
//Force cargo.toml to use the correct version of tree-sitter
await execPromise(`for cargo in ${tsLangDir}/[Cc]argo.toml; do
if [ -f "$cargo" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fn main() {
let mut c_config = cc::Build::new();
c_config.include(src_dir);
c_config
.flag_if_supported("-w")
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
let parser_path = src_dir.join("parser.c");
Expand Down
Loading
Loading