--- 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", --- 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}; --- 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)] --- 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", --- 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(),