Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/squawk_ide/src/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub(crate) fn is_string_or_comment(kind: SyntaxKind) -> bool {
SyntaxKind::COMMENT
| SyntaxKind::STRING
| SyntaxKind::BYTE_STRING
| SyntaxKind::UNICODE_ESC_STRING
| SyntaxKind::BIT_STRING
| SyntaxKind::DOLLAR_QUOTED_STRING
| SyntaxKind::ESC_STRING
Expand Down
1 change: 1 addition & 0 deletions crates/squawk_parser/src/generated/syntax_kind.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/squawk_parser/src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn literal(p: &mut Parser<'_>) -> Option<CompletedMarker> {
return None;
}
let m = p.start();
if p.eat(BYTE_STRING) {
if p.eat(UNICODE_ESC_STRING) {
if p.eat(UESCAPE_KW) {
p.eat(STRING);
}
Expand Down Expand Up @@ -4802,6 +4802,7 @@ const NUMERIC_FIRST: TokenSet = TokenSet::new(&[INT_NUMBER, FLOAT_NUMBER]);
const STRING_FIRST: TokenSet = TokenSet::new(&[
STRING,
BYTE_STRING,
UNICODE_ESC_STRING,
BIT_STRING,
DOLLAR_QUOTED_STRING,
ESC_STRING,
Expand Down
2 changes: 1 addition & 1 deletion crates/squawk_parser/src/lexed_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl<'a> Converter<'a> {
err = "Missing trailing `'` symbol to terminate the unicode escape string literal";
}
// TODO: rust analzyer checks for un-escaped strings, we should too
SyntaxKind::BYTE_STRING
SyntaxKind::UNICODE_ESC_STRING
}
squawk_lexer::LiteralKind::EscStr { terminated } => {
if !terminated {
Expand Down
18 changes: 0 additions & 18 deletions crates/squawk_parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,24 +424,6 @@ impl<'t> Parser<'t> {
m.complete(self, SyntaxKind::IS_NOT);
return true;
}
// SyntaxKind::BYTE_STRING => {
// let m = self.start();
// self.bump(SyntaxKind::BYTE_STRING);
// if self.eat(SyntaxKind::UESCAPE_KW) {
// self.expect(SyntaxKind::STRING);
// }
// m.complete(self, SyntaxKind::BYTE_STRING);
// return true;
// }
// SyntaxKind::IDENT => {
// let m = self.start();
// self.bump(SyntaxKind::IDENT);
// if self.eat(SyntaxKind::UESCAPE_KW) {
// self.expect(SyntaxKind::STRING);
// }
// m.complete(self, SyntaxKind::IDENT);
// return true;
// }
SyntaxKind::CUSTOM_OP => {
let m = self.start();
while !self.at(SyntaxKind::EOF) {
Expand Down
2 changes: 1 addition & 1 deletion crates/squawk_parser/tests/snapshots/tests__select_ok.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6234,7 +6234,7 @@ SOURCE_FILE
TARGET_LIST
TARGET
LITERAL
BYTE_STRING "U&' \\'"
UNICODE_ESC_STRING "U&' \\'"
WHITESPACE " "
UESCAPE_KW "UESCAPE"
WHITESPACE " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ SOURCE_FILE
TARGET
POSTFIX_EXPR
LITERAL
BYTE_STRING "U&'\\0061\\0308bc'"
UNICODE_ESC_STRING "U&'\\0061\\0308bc'"
WHITESPACE " "
IS_NORMALIZED
IS_KW "is"
Expand All @@ -1760,7 +1760,7 @@ SOURCE_FILE
TARGET
POSTFIX_EXPR
LITERAL
BYTE_STRING "U&'\\0061\\0308bc'"
UNICODE_ESC_STRING "U&'\\0061\\0308bc'"
WHITESPACE " "
IS_NORMALIZED
IS_KW "is"
Expand All @@ -1778,7 +1778,7 @@ SOURCE_FILE
TARGET
POSTFIX_EXPR
LITERAL
BYTE_STRING "U&'\\0061\\0308bc'"
UNICODE_ESC_STRING "U&'\\0061\\0308bc'"
WHITESPACE " "
IS_NORMALIZED
IS_KW "is"
Expand All @@ -1796,7 +1796,7 @@ SOURCE_FILE
TARGET
POSTFIX_EXPR
LITERAL
BYTE_STRING "U&'\\0061\\0308bc'"
UNICODE_ESC_STRING "U&'\\0061\\0308bc'"
WHITESPACE " "
IS_NORMALIZED
IS_KW "is"
Expand All @@ -1814,7 +1814,7 @@ SOURCE_FILE
TARGET
POSTFIX_EXPR
LITERAL
BYTE_STRING "U&'\\0061\\0308bc'"
UNICODE_ESC_STRING "U&'\\0061\\0308bc'"
WHITESPACE " "
IS_NORMALIZED
IS_KW "is"
Expand All @@ -1832,7 +1832,7 @@ SOURCE_FILE
TARGET
BIN_EXPR
LITERAL
BYTE_STRING "U&'\\0061\\0308bc'"
UNICODE_ESC_STRING "U&'\\0061\\0308bc'"
WHITESPACE " "
IS_NOT
IS_KW "is"
Expand Down
1 change: 1 addition & 0 deletions crates/squawk_syntax/src/postgresql.ungram
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ Literal =
| '@byte_string'
| '@bit_string'
| '@dollar_quoted_string'
| '@unicode_esc_string'
| '@esc_string'
| '@positional_param'
)
Expand Down
Loading