git.delta.rocks / jrsonnet / refs/commits / 69c08119b19c

difftreelog

feat different names for strings and comments

wvmwvnroYaroslav Bolyukin2026-04-25parent: #b857448.patch.diff
in: master

5 files changed

modifiedcrates/jrsonnet-lexer/src/generated/syntax_kinds.rsdiffbeforeafterboth
--- a/crates/jrsonnet-lexer/src/generated/syntax_kinds.rs
+++ b/crates/jrsonnet-lexer/src/generated/syntax_kinds.rs
@@ -284,29 +284,29 @@
 			ERROR_FLOAT_JUNK_AFTER_POINT => "junk after decimal point in number literal",
 			ERROR_FLOAT_JUNK_AFTER_EXPONENT => "junk after exponent in number literal",
 			ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => "junk after exponent sign in number literal",
-			STRING_DOUBLE => "string",
+			STRING_DOUBLE => "\"string\"",
 			ERROR_STRING_DOUBLE_UNTERMINATED => "unterminated double-quoted string",
-			STRING_SINGLE => "string",
+			STRING_SINGLE => "'string'",
 			ERROR_STRING_SINGLE_UNTERMINATED => "unterminated single-quoted string",
-			STRING_DOUBLE_VERBATIM => "string",
+			STRING_DOUBLE_VERBATIM => "@\"string\"",
 			ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {
 				"unterminated verbatim double-quoted string"
 			}
-			STRING_SINGLE_VERBATIM => "string",
+			STRING_SINGLE_VERBATIM => "@'string'",
 			ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {
 				"unterminated verbatim single-quoted string"
 			}
 			ERROR_STRING_VERBATIM_MISSING_QUOTES => "verbatim string missing opening quotes",
-			STRING_BLOCK => "string",
+			STRING_BLOCK => "|||string|||",
 			ERROR_STRING_BLOCK_UNEXPECTED_END => "unexpected end of text block",
 			ERROR_STRING_BLOCK_MISSING_NEW_LINE => "text block requires new line after |||",
 			ERROR_STRING_BLOCK_MISSING_TERMINATION => "unterminated text block",
 			ERROR_STRING_BLOCK_MISSING_INDENT => "text block first line must be indented",
 			IDENT => "identifier",
 			WHITESPACE => "whitespace",
-			SINGLE_LINE_SLASH_COMMENT => "comment",
-			SINGLE_LINE_HASH_COMMENT => "comment",
-			MULTI_LINE_COMMENT => "comment",
+			SINGLE_LINE_SLASH_COMMENT => "//comment",
+			SINGLE_LINE_HASH_COMMENT => "#comment",
+			MULTI_LINE_COMMENT => "/*comment*/",
 			ERROR_COMMENT_TOO_SHORT => "comment too short",
 			ERROR_COMMENT_UNTERMINATED => "unterminated multi-line comment",
 			ERROR_NO_OPERATOR => "expected operator",
modifiedcrates/jrsonnet-lexer/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-lexer/src/lib.rs
+++ b/crates/jrsonnet-lexer/src/lib.rs
@@ -6,5 +6,5 @@
 pub struct Span(pub u32, pub u32);
 
 pub use generated::syntax_kinds::SyntaxKind;
-pub use lex::{Lexeme, Lexer};
+pub use lex::{Lexeme, Lexer, lex};
 pub use string_block::{CollectStrBlock, collect_lexed_str_block};
modifiedcrates/jrsonnet-rowan-parser/src/generated/nodes.rsdiffbeforeafterboth
33
4#![allow(non_snake_case, clippy::match_like_matches_macro)]4#![allow(non_snake_case, clippy::match_like_matches_macro)]
5use crate::{5use crate::{
6 ast::{support, AstChildren, AstNode, AstToken},
6 SyntaxKind::{self, *},7 SyntaxKind::{self, *},
7 SyntaxNode, SyntaxToken, T,8 SyntaxNode, SyntaxToken, T,
8 ast::{AstChildren, AstNode, AstToken, support},
9};9};
1010
11#[derive(Debug, Clone, PartialEq, Eq, Hash)]11#[derive(Debug, Clone, PartialEq, Eq, Hash)]
modifiedcrates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs
+++ b/crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rs
@@ -290,29 +290,29 @@
 			ERROR_FLOAT_JUNK_AFTER_POINT => "junk after decimal point in number literal",
 			ERROR_FLOAT_JUNK_AFTER_EXPONENT => "junk after exponent in number literal",
 			ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => "junk after exponent sign in number literal",
-			STRING_DOUBLE => "string",
+			STRING_DOUBLE => "\"string\"",
 			ERROR_STRING_DOUBLE_UNTERMINATED => "unterminated double-quoted string",
-			STRING_SINGLE => "string",
+			STRING_SINGLE => "'string'",
 			ERROR_STRING_SINGLE_UNTERMINATED => "unterminated single-quoted string",
-			STRING_DOUBLE_VERBATIM => "string",
+			STRING_DOUBLE_VERBATIM => "@\"string\"",
 			ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {
 				"unterminated verbatim double-quoted string"
 			}
-			STRING_SINGLE_VERBATIM => "string",
+			STRING_SINGLE_VERBATIM => "@'string'",
 			ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {
 				"unterminated verbatim single-quoted string"
 			}
 			ERROR_STRING_VERBATIM_MISSING_QUOTES => "verbatim string missing opening quotes",
-			STRING_BLOCK => "string",
+			STRING_BLOCK => "|||string|||",
 			ERROR_STRING_BLOCK_UNEXPECTED_END => "unexpected end of text block",
 			ERROR_STRING_BLOCK_MISSING_NEW_LINE => "text block requires new line after |||",
 			ERROR_STRING_BLOCK_MISSING_TERMINATION => "unterminated text block",
 			ERROR_STRING_BLOCK_MISSING_INDENT => "text block first line must be indented",
 			IDENT => "identifier",
 			WHITESPACE => "whitespace",
-			SINGLE_LINE_SLASH_COMMENT => "comment",
-			SINGLE_LINE_HASH_COMMENT => "comment",
-			MULTI_LINE_COMMENT => "comment",
+			SINGLE_LINE_SLASH_COMMENT => "//comment",
+			SINGLE_LINE_HASH_COMMENT => "#comment",
+			MULTI_LINE_COMMENT => "/*comment*/",
 			ERROR_COMMENT_TOO_SHORT => "comment too short",
 			ERROR_COMMENT_UNTERMINATED => "unterminated multi-line comment",
 			ERROR_NO_OPERATOR => "expected operator",
modifiedxtask/src/sourcegen/kinds.rsdiffbeforeafterboth
--- a/xtask/src/sourcegen/kinds.rs
+++ b/xtask/src/sourcegen/kinds.rs
@@ -120,15 +120,15 @@
 			Self::Literal { name, .. } => match name.as_str() {
 				"FLOAT" => "number".to_owned(),
 				"IDENT" => "identifier".to_owned(),
-				"STRING_DOUBLE"
-				| "STRING_SINGLE"
-				| "STRING_DOUBLE_VERBATIM"
-				| "STRING_SINGLE_VERBATIM"
-				| "STRING_BLOCK" => "string".to_owned(),
+				"STRING_DOUBLE" => "\"string\"".to_owned(),
+				"STRING_SINGLE" => "'string'".to_owned(),
+				"STRING_DOUBLE_VERBATIM" => "@\"string\"".to_owned(),
+				"STRING_SINGLE_VERBATIM" => "@'string'".to_owned(),
+				"STRING_BLOCK" => "|||string|||".to_owned(),
 				"WHITESPACE" => "whitespace".to_owned(),
-				"SINGLE_LINE_SLASH_COMMENT" | "SINGLE_LINE_HASH_COMMENT" | "MULTI_LINE_COMMENT" => {
-					"comment".to_owned()
-				}
+				"SINGLE_LINE_SLASH_COMMENT" => "//comment".to_owned(),
+				"SINGLE_LINE_HASH_COMMENT" => "#comment".to_owned(),
+				"MULTI_LINE_COMMENT" => "/*comment*/".to_owned(),
 				_ => name.to_lowercase(),
 			},
 			Self::Meta { name, .. } => name.to_lowercase(),