mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
fix: add DESCRIPTION to grammar Makefile template
This commit is contained in:
parent
2fddf5a1b4
commit
e502c6c18e
|
|
@ -737,6 +737,19 @@ pub fn generate_grammar_files(
|
|||
"}
|
||||
);
|
||||
}
|
||||
if !contents.contains("\nDESCRIPTION :=") {
|
||||
if let Some(version_line) = contents.lines().find(|l| l.starts_with("VERSION := ")) {
|
||||
info!("Adding DESCRIPTION to Makefile");
|
||||
let description = generate_opts.description.map_or_else(
|
||||
|| format!("{} grammar for tree-sitter", generate_opts.camel_parser_name),
|
||||
str::to_string,
|
||||
);
|
||||
contents = contents.replace(
|
||||
version_line,
|
||||
&format!("{version_line}\nDESCRIPTION := {description}"),
|
||||
);
|
||||
}
|
||||
}
|
||||
write_file(path, contents)?;
|
||||
}
|
||||
Ok(())
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
LANGUAGE_NAME := tree-sitter-KEBAB_PARSER_NAME
|
||||
HOMEPAGE_URL := PARSER_URL
|
||||
VERSION := PARSER_VERSION
|
||||
DESCRIPTION := PARSER_DESCRIPTION
|
||||
|
||||
# repository
|
||||
SRC_DIR := src
|
||||
|
|
|
|||
Loading…
Reference in a new issue