docs: change WASM/wasm to Wasm

That is the official capitalisation.
This commit is contained in:
ObserverOfTime 2025-08-19 12:32:46 +03:00
parent 7bc8f76667
commit 88e0b4cea4
36 changed files with 122 additions and 122 deletions

View file

@ -153,7 +153,7 @@ struct Generate {
#[derive(Args)]
#[command(alias = "b")]
struct Build {
/// Build a WASM module instead of a dynamic library
/// Build a Wasm module instead of a dynamic library
#[arg(short, long)]
pub wasm: bool,
/// No longer used.
@ -205,7 +205,7 @@ struct Parse {
/// Produce the log.html file with debug graphs
#[arg(long, short = 'D')]
pub debug_graph: bool,
/// Compile parsers to wasm instead of native dynamic libraries
/// Compile parsers to Wasm instead of native dynamic libraries
#[arg(long)]
pub wasm: bool,
/// Output the parse data with graphviz dot
@ -302,7 +302,7 @@ struct Test {
/// Produce the log.html file with debug graphs
#[arg(long, short = 'D')]
pub debug_graph: bool,
/// Compile parsers to wasm instead of native dynamic libraries
/// Compile parsers to Wasm instead of native dynamic libraries
#[arg(long)]
pub wasm: bool,
/// Open `log.html` in the default browser, if `--debug-graph` is supplied
@ -520,7 +520,7 @@ struct Playground {
/// Don't open in default browser
#[arg(long, short)]
pub quiet: bool,
/// Path to the directory containing the grammar and wasm files
/// Path to the directory containing the grammar and Wasm files
#[arg(long)]
pub grammar_path: Option<PathBuf>,
}

View file

@ -116,7 +116,7 @@ fn test_load_multiple_wasm_languages() {
let mut query_cursor = QueryCursor::new();
// First, parse with the store that originally loaded the languages.
// Then parse with a new parser and wasm store, so that the languages
// Then parse with a new parser and Wasm store, so that the languages
// are added one-by-one, in between parses.
for mut parser in [parser, parser2] {
for _ in 0..2 {
@ -226,7 +226,7 @@ fn test_load_wasm_errors() {
store.load_language("rust", bad_wasm).unwrap_err(),
WasmError {
kind: WasmErrorKind::Parse,
message: "failed to parse dylink section of wasm module".into(),
message: "failed to parse dylink section of Wasm module".into(),
}
);

View file

@ -11,7 +11,7 @@ use wasmparser::Parser;
pub fn load_language_wasm_file(language_dir: &Path) -> Result<(String, Vec<u8>)> {
let grammar_name = get_grammar_name(language_dir)
.with_context(|| "Failed to get wasm filename")
.with_context(|| "Failed to get Wasm filename")
.unwrap();
let wasm_filename = format!("tree-sitter-{grammar_name}.wasm");
let contents = fs::read(language_dir.join(&wasm_filename)).with_context(|| {
@ -61,7 +61,7 @@ pub fn compile_language_to_wasm(
)?;
// Exit with an error if the external scanner uses symbols from the
// C or C++ standard libraries that aren't available to wasm parsers.
// C or C++ standard libraries that aren't available to Wasm parsers.
let stdlib_symbols = wasm_stdlib_symbols().collect::<Vec<_>>();
let dylink_symbols = [
"__indirect_function_table",
@ -100,7 +100,7 @@ pub fn compile_language_to_wasm(
if !missing_symbols.is_empty() {
Err(anyhow!(
concat!(
"This external scanner uses a symbol that isn't available to wasm parsers.\n",
"This external scanner uses a symbol that isn't available to Wasm parsers.\n",
"\n",
"Missing symbols:\n",
" {}\n",

View file

@ -1068,7 +1068,7 @@ impl Loader {
}
fs::rename(src_path.join(output_name), output_path)
.context("failed to rename wasm output file")?;
.context("failed to rename Wasm output file")?;
Ok(())
}

View file

@ -195,7 +195,7 @@ pub fn run_wasm(args: &BuildWasm) -> Result<()> {
fn build_wasm(cmd: &mut Command) -> Result<()> {
bail_on_err(
&cmd.spawn()?.wait_with_output()?,
"Failed to compile the Tree-sitter WASM library",
"Failed to compile the Tree-sitter Wasm library",
)?;
Ok(())
@ -239,7 +239,7 @@ pub fn run_wasm_stdlib() -> Result<()> {
.arg("lib/src/wasm/stdlib.c")
.output()?;
bail_on_err(&output, "Failed to compile the Tree-sitter WASM stdlib")?;
bail_on_err(&output, "Failed to compile the Tree-sitter Wasm stdlib")?;
let xxd = Command::new("xxd")
.args(["-C", "-i", "stdlib.wasm"])
@ -247,7 +247,7 @@ pub fn run_wasm_stdlib() -> Result<()> {
bail_on_err(
&xxd,
"Failed to run xxd on the compiled Tree-sitter WASM stdlib",
"Failed to run xxd on the compiled Tree-sitter Wasm stdlib",
)?;
fs::write("lib/src/wasm/wasm-stdlib.h", xxd.stdout)?;

View file

@ -25,7 +25,7 @@ const EXCLUDES: [&str; 27] = [
"ts_node_eq",
"ts_tree_cursor_current_field_name",
"ts_lookahead_iterator_current_symbol_name",
// Not used in wasm
// Not used in Wasm
"ts_init",
"ts_set_allocator",
"ts_parser_set_cancellation_flag",
@ -126,7 +126,7 @@ fn check_wasm_exports() -> Result<()> {
if !missing.is_empty() {
Err(anyhow!(format!(
"Unmatched wasm exports:\n{}",
"Unmatched Wasm exports:\n{}",
missing.join("\n")
)))?;
}

View file

@ -30,7 +30,7 @@ pub fn run_fixtures(args: &GenerateFixtures) -> Result<()> {
println!(
"Regenerating {grammar_name} parser{}",
if args.wasm { " to wasm" } else { "" }
if args.wasm { " to Wasm" } else { "" }
);
if args.wasm {

View file

@ -22,14 +22,14 @@ use semver::Version;
enum Commands {
/// Runs `cargo benchmark` with some optional environment variables set.
Benchmark(Benchmark),
/// Compile the Tree-sitter WASM library. This will create two files in the
/// Compile the Tree-sitter Wasm library. This will create two files in the
/// `lib/binding_web` directory: `web-tree-sitter.js` and `web-tree-sitter.wasm`.
BuildWasm(BuildWasm),
/// Compile the Tree-sitter WASM standard library.
/// Compile the Tree-sitter Wasm standard library.
BuildWasmStdlib,
/// Bumps the version of the workspace.
BumpVersion(BumpVersion),
/// Checks that WASM exports are synced.
/// Checks that Wasm exports are synced.
CheckWasmExports(CheckWasmExports),
/// Runs `cargo clippy`.
Clippy(Clippy),
@ -41,11 +41,11 @@ enum Commands {
GenerateBindings,
/// Generates the fixtures for testing tree-sitter.
GenerateFixtures(GenerateFixtures),
/// Generate the list of exports from Tree-sitter WASM files.
/// Generate the list of exports from Tree-sitter Wasm files.
GenerateWasmExports,
/// Run the test suite
Test(Test),
/// Run the WASM test suite
/// Run the Wasm test suite
TestWasm,
/// Upgrade the wasmtime dependency.
UpgradeWasmtime(UpgradeWasmtime),
@ -120,7 +120,7 @@ struct Clippy {
#[derive(Args)]
struct GenerateFixtures {
/// Generates the parser to WASM
/// Generates the parser to Wasm
#[arg(long, short)]
wasm: bool,
}
@ -156,7 +156,7 @@ struct Test {
/// Don't capture the output
#[arg(long)]
nocapture: bool,
/// Enable the wasm tests.
/// Enable the Wasm tests.
#[arg(long, short)]
wasm: bool,
}