-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix: upgrade yaml submodule #413
Changes from all commits
36021b9
dc00177
1079d33
890bab2
22794ef
a82d842
2c3c2d9
1b3edec
b278d6f
4f65f17
3519f6c
bbe3897
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -92,13 +92,13 @@ const copyMvGrammar = async (lang, dest) => { | |||||||||||||||||||||||||||||||
if (languagesWithoutMetaVariables.includes(lang)) { | ||||||||||||||||||||||||||||||||
return; | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
await fs.copyFile( | ||||||||||||||||||||||||||||||||
`${METAVARIABLE_GRAMMARS_DIR}/${lang}-metavariable-grammar.js`, | ||||||||||||||||||||||||||||||||
path.join( | ||||||||||||||||||||||||||||||||
LANGUAGE_METAVARIABLES_DIR, | ||||||||||||||||||||||||||||||||
`tree-sitter-${dest ?? lang}/grammar.js` | ||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||
let from = `${METAVARIABLE_GRAMMARS_DIR}/${lang}-metavariable-grammar.js`; | ||||||||||||||||||||||||||||||||
let to = path.join( | ||||||||||||||||||||||||||||||||
LANGUAGE_METAVARIABLES_DIR, | ||||||||||||||||||||||||||||||||
`tree-sitter-${dest ?? lang}/grammar.js` | ||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||
await fs.copyFile(from, to); | ||||||||||||||||||||||||||||||||
console.log(`Copied ${from} to ${to}`); | ||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
|
@@ -118,15 +118,6 @@ const copyMyBuild = async (c, lang, dest) => | |||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
const copyMvScanner = async (lang, dest) => | ||||||||||||||||||||||||||||||||
fs.copyFile( | ||||||||||||||||||||||||||||||||
`${METAVARIABLE_GRAMMARS_DIR}/${lang}-metavariable-scanner.cc`, | ||||||||||||||||||||||||||||||||
path.join( | ||||||||||||||||||||||||||||||||
LANGUAGE_METAVARIABLES_DIR, | ||||||||||||||||||||||||||||||||
`tree-sitter-${dest ?? lang}/src/scanner.cc` | ||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
const treeSitterGenerate = async (dir, buildWasm = true) => { | ||||||||||||||||||||||||||||||||
const andMaybeBuildWasm = buildWasm ? "&& tree-sitter build-wasm " : ""; | ||||||||||||||||||||||||||||||||
await execPromise( | ||||||||||||||||||||||||||||||||
|
@@ -339,12 +330,12 @@ async function buildLanguage(language) { | |||||||||||||||||||||||||||||||
`${tsLangDir}/bindings/rust/build.rs` | ||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||
} else if (language === "yaml") { | ||||||||||||||||||||||||||||||||
await copyMvScanner(language); | ||||||||||||||||||||||||||||||||
await buildSimpleLanguage(log, language); | ||||||||||||||||||||||||||||||||
await fs.copyFile( | ||||||||||||||||||||||||||||||||
`${METAVARIABLE_GRAMMARS_DIR}/cc_build.rs`, | ||||||||||||||||||||||||||||||||
`${tsLangDir}/bindings/rust/build.rs` | ||||||||||||||||||||||||||||||||
`${METAVARIABLE_GRAMMARS_DIR}/${language}-metavariable-scanner.c`, | ||||||||||||||||||||||||||||||||
`${tsLangDir}/src/scanner.c` | ||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||
await buildSimpleLanguage(log, language); | ||||||||||||||||||||||||||||||||
await copyMyBuild("c", language); | ||||||||||||||||||||||||||||||||
Comment on lines
+334
to
+338
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure proper handling of YAML language build steps. The steps for copying the scanner file and building the language are correctly defined. Consider adding error handling for the file copy and build operations to improve robustness. try {
await fs.copyFile(
`${METAVARIABLE_GRAMMARS_DIR}/${language}-metavariable-scanner.c`,
`${tsLangDir}/src/scanner.c`
);
await buildSimpleLanguage(log, language);
await copyMyBuild("c", language);
} catch (error) {
log(`Error handling YAML language build steps:`, error);
} Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||
} else if (language === "hcl") { | ||||||||||||||||||||||||||||||||
//HCL's mv grammar goes into `make_grammar.js`, not `grammar.js` | ||||||||||||||||||||||||||||||||
await fs.copyFile( | ||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* text eol=lf | ||
|
||
src/*.json linguist-generated | ||
src/parser.c linguist-generated | ||
src/tree_sitter/* linguist-generated | ||
|
||
bindings/** linguist-generated | ||
binding.gyp linguist-generated | ||
setup.py linguist-generated | ||
Makefile linguist-generated | ||
Package.swift linguist-generated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Rust artifacts | ||
Cargo.lock | ||
target/ | ||
|
||
# Node artifacts | ||
build/ | ||
prebuilds/ | ||
node_modules/ | ||
*.tgz | ||
|
||
# Swift artifacts | ||
.build/ | ||
|
||
# Go artifacts | ||
go.sum | ||
_obj/ | ||
|
||
# Python artifacts | ||
.venv/ | ||
dist/ | ||
*.egg-info | ||
*.whl | ||
|
||
# C artifacts | ||
*.a | ||
*.so | ||
*.so.* | ||
*.dylib | ||
*.dll | ||
*.pc | ||
|
||
# Example dirs | ||
/examples/*/ | ||
|
||
# Grammar volatiles | ||
*.wasm | ||
*.obj | ||
*.o |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure path definitions are correct and handle potential errors.
The paths for source and destination are defined correctly. However, it is good practice to handle potential errors during the file copy operation to improve robustness.
Committable suggestion