difftreelog
feat different names for strings and comments
in: master
5 files changed
crates/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",
crates/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};
crates/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)]
crates/jrsonnet-rowan-parser/src/generated/syntax_kinds.rsdiffbeforeafterboth290 ERROR_FLOAT_JUNK_AFTER_POINT => "junk after decimal point in number literal",290 ERROR_FLOAT_JUNK_AFTER_POINT => "junk after decimal point in number literal",291 ERROR_FLOAT_JUNK_AFTER_EXPONENT => "junk after exponent in number literal",291 ERROR_FLOAT_JUNK_AFTER_EXPONENT => "junk after exponent in number literal",292 ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => "junk after exponent sign in number literal",292 ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN => "junk after exponent sign in number literal",293 STRING_DOUBLE => "string",293 STRING_DOUBLE => "\"string\"",294 ERROR_STRING_DOUBLE_UNTERMINATED => "unterminated double-quoted string",294 ERROR_STRING_DOUBLE_UNTERMINATED => "unterminated double-quoted string",295 STRING_SINGLE => "string",295 STRING_SINGLE => "'string'",296 ERROR_STRING_SINGLE_UNTERMINATED => "unterminated single-quoted string",296 ERROR_STRING_SINGLE_UNTERMINATED => "unterminated single-quoted string",297 STRING_DOUBLE_VERBATIM => "string",297 STRING_DOUBLE_VERBATIM => "@\"string\"",298 ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {298 ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED => {299 "unterminated verbatim double-quoted string"299 "unterminated verbatim double-quoted string"300 }300 }301 STRING_SINGLE_VERBATIM => "string",301 STRING_SINGLE_VERBATIM => "@'string'",302 ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {302 ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED => {303 "unterminated verbatim single-quoted string"303 "unterminated verbatim single-quoted string"304 }304 }305 ERROR_STRING_VERBATIM_MISSING_QUOTES => "verbatim string missing opening quotes",305 ERROR_STRING_VERBATIM_MISSING_QUOTES => "verbatim string missing opening quotes",306 STRING_BLOCK => "string",306 STRING_BLOCK => "|||string|||",307 ERROR_STRING_BLOCK_UNEXPECTED_END => "unexpected end of text block",307 ERROR_STRING_BLOCK_UNEXPECTED_END => "unexpected end of text block",308 ERROR_STRING_BLOCK_MISSING_NEW_LINE => "text block requires new line after |||",308 ERROR_STRING_BLOCK_MISSING_NEW_LINE => "text block requires new line after |||",309 ERROR_STRING_BLOCK_MISSING_TERMINATION => "unterminated text block",309 ERROR_STRING_BLOCK_MISSING_TERMINATION => "unterminated text block",310 ERROR_STRING_BLOCK_MISSING_INDENT => "text block first line must be indented",310 ERROR_STRING_BLOCK_MISSING_INDENT => "text block first line must be indented",311 IDENT => "identifier",311 IDENT => "identifier",312 WHITESPACE => "whitespace",312 WHITESPACE => "whitespace",313 SINGLE_LINE_SLASH_COMMENT => "comment",313 SINGLE_LINE_SLASH_COMMENT => "//comment",314 SINGLE_LINE_HASH_COMMENT => "comment",314 SINGLE_LINE_HASH_COMMENT => "#comment",315 MULTI_LINE_COMMENT => "comment",315 MULTI_LINE_COMMENT => "/*comment*/",316 ERROR_COMMENT_TOO_SHORT => "comment too short",316 ERROR_COMMENT_TOO_SHORT => "comment too short",317 ERROR_COMMENT_UNTERMINATED => "unterminated multi-line comment",317 ERROR_COMMENT_UNTERMINATED => "unterminated multi-line comment",318 ERROR_NO_OPERATOR => "expected operator",318 ERROR_NO_OPERATOR => "expected operator",xtask/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(),