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
284 ERROR_FLOAT_JUNK_AFTER_POINT => "junk after decimal point in number literal",284 ERROR_FLOAT_JUNK_AFTER_POINT => "junk after decimal point in number literal",
285 ERROR_FLOAT_JUNK_AFTER_EXPONENT => "junk after exponent in number literal",285 ERROR_FLOAT_JUNK_AFTER_EXPONENT => "junk after exponent in number literal",
286 ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => "junk after exponent sign in number literal",286 ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => "junk after exponent sign in number literal",
287 STRING_DOUBLE => "string",287 STRING_DOUBLE => "\"string\"",
288 ERROR_STRING_DOUBLE_UNTERMINATED => "unterminated double-quoted string",288 ERROR_STRING_DOUBLE_UNTERMINATED => "unterminated double-quoted string",
289 STRING_SINGLE => "string",289 STRING_SINGLE => "'string'",
290 ERROR_STRING_SINGLE_UNTERMINATED => "unterminated single-quoted string",290 ERROR_STRING_SINGLE_UNTERMINATED => "unterminated single-quoted string",
291 STRING_DOUBLE_VERBATIM => "string",291 STRING_DOUBLE_VERBATIM => "@\"string\"",
292 ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {292 ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {
293 "unterminated verbatim double-quoted string"293 "unterminated verbatim double-quoted string"
294 }294 }
295 STRING_SINGLE_VERBATIM => "string",295 STRING_SINGLE_VERBATIM => "@'string'",
296 ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {296 ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {
297 "unterminated verbatim single-quoted string"297 "unterminated verbatim single-quoted string"
298 }298 }
299 ERROR_STRING_VERBATIM_MISSING_QUOTES => "verbatim string missing opening quotes",299 ERROR_STRING_VERBATIM_MISSING_QUOTES => "verbatim string missing opening quotes",
300 STRING_BLOCK => "string",300 STRING_BLOCK => "|||string|||",
301 ERROR_STRING_BLOCK_UNEXPECTED_END => "unexpected end of text block",301 ERROR_STRING_BLOCK_UNEXPECTED_END => "unexpected end of text block",
302 ERROR_STRING_BLOCK_MISSING_NEW_LINE => "text block requires new line after |||",302 ERROR_STRING_BLOCK_MISSING_NEW_LINE => "text block requires new line after |||",
303 ERROR_STRING_BLOCK_MISSING_TERMINATION => "unterminated text block",303 ERROR_STRING_BLOCK_MISSING_TERMINATION => "unterminated text block",
304 ERROR_STRING_BLOCK_MISSING_INDENT => "text block first line must be indented",304 ERROR_STRING_BLOCK_MISSING_INDENT => "text block first line must be indented",
305 IDENT => "identifier",305 IDENT => "identifier",
306 WHITESPACE => "whitespace",306 WHITESPACE => "whitespace",
307 SINGLE_LINE_SLASH_COMMENT => "comment",307 SINGLE_LINE_SLASH_COMMENT => "//comment",
308 SINGLE_LINE_HASH_COMMENT => "comment",308 SINGLE_LINE_HASH_COMMENT => "#comment",
309 MULTI_LINE_COMMENT => "comment",309 MULTI_LINE_COMMENT => "/*comment*/",
310 ERROR_COMMENT_TOO_SHORT => "comment too short",310 ERROR_COMMENT_TOO_SHORT => "comment too short",
311 ERROR_COMMENT_UNTERMINATED => "unterminated multi-line comment",311 ERROR_COMMENT_UNTERMINATED => "unterminated multi-line comment",
312 ERROR_NO_OPERATOR => "expected operator",312 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
--- a/crates/jrsonnet-rowan-parser/src/generated/nodes.rs
+++ b/crates/jrsonnet-rowan-parser/src/generated/nodes.rs
@@ -3,9 +3,9 @@
 
 #![allow(non_snake_case, clippy::match_like_matches_macro)]
 use crate::{
+	ast::{support, AstChildren, AstNode, AstToken},
 	SyntaxKind::{self, *},
 	SyntaxNode, SyntaxToken, T,
-	ast::{AstChildren, AstNode, AstToken, support},
 };
 
 #[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(),