Skip to content

Commit 71318df

Browse files
authored
chore: remove redundant punctuation (#1434)
1 parent 04a53e5 commit 71318df

7 files changed

+16
-16
lines changed

src/parser/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ impl<'a> Parser<'a> {
12641264
self.prev_token();
12651265
self.parse_duckdb_struct_literal()
12661266
}
1267-
_ => self.expected("an expression:", next_token),
1267+
_ => self.expected("an expression", next_token),
12681268
}?;
12691269

12701270
if self.parse_keyword(Keyword::COLLATE) {

tests/sqlparser_clickhouse.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,13 @@ fn parse_alter_table_attach_and_detach_partition() {
276276
clickhouse_and_generic()
277277
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PARTITION").as_str())
278278
.unwrap_err(),
279-
ParserError("Expected: an expression:, found: EOF".to_string())
279+
ParserError("Expected: an expression, found: EOF".to_string())
280280
);
281281
assert_eq!(
282282
clickhouse_and_generic()
283283
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PART").as_str())
284284
.unwrap_err(),
285-
ParserError("Expected: an expression:, found: EOF".to_string())
285+
ParserError("Expected: an expression, found: EOF".to_string())
286286
);
287287
}
288288
}
@@ -355,7 +355,7 @@ fn parse_alter_table_add_projection() {
355355
clickhouse_and_generic()
356356
.parse_sql_statements("ALTER TABLE t0 ADD PROJECTION my_name (SELECT)")
357357
.unwrap_err(),
358-
ParserError("Expected: an expression:, found: )".to_string())
358+
ParserError("Expected: an expression, found: )".to_string())
359359
);
360360
}
361361

@@ -498,13 +498,13 @@ fn parse_optimize_table() {
498498
clickhouse_and_generic()
499499
.parse_sql_statements("OPTIMIZE TABLE t0 DEDUPLICATE BY")
500500
.unwrap_err(),
501-
ParserError("Expected: an expression:, found: EOF".to_string())
501+
ParserError("Expected: an expression, found: EOF".to_string())
502502
);
503503
assert_eq!(
504504
clickhouse_and_generic()
505505
.parse_sql_statements("OPTIMIZE TABLE t0 PARTITION")
506506
.unwrap_err(),
507-
ParserError("Expected: an expression:, found: EOF".to_string())
507+
ParserError("Expected: an expression, found: EOF".to_string())
508508
);
509509
assert_eq!(
510510
clickhouse_and_generic()
@@ -1479,7 +1479,7 @@ fn parse_freeze_and_unfreeze_partition() {
14791479
clickhouse_and_generic()
14801480
.parse_sql_statements(format!("ALTER TABLE t0 {operation_name} PARTITION").as_str())
14811481
.unwrap_err(),
1482-
ParserError("Expected: an expression:, found: EOF".to_string())
1482+
ParserError("Expected: an expression, found: EOF".to_string())
14831483
);
14841484
assert_eq!(
14851485
clickhouse_and_generic()

tests/sqlparser_common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ fn parse_tuple_invalid() {
20512051
let sql = "select (), 2";
20522052
let res = parse_sql_statements(sql);
20532053
assert_eq!(
2054-
ParserError::ParserError("Expected: an expression:, found: )".to_string()),
2054+
ParserError::ParserError("Expected: an expression, found: )".to_string()),
20552055
res.unwrap_err()
20562056
);
20572057
}
@@ -9556,7 +9556,7 @@ fn parse_projection_trailing_comma() {
95569556
trailing_commas
95579557
.parse_sql_statements("SELECT * FROM track ORDER BY milliseconds,")
95589558
.unwrap_err(),
9559-
ParserError::ParserError("Expected: an expression:, found: EOF".to_string())
9559+
ParserError::ParserError("Expected: an expression, found: EOF".to_string())
95609560
);
95619561

95629562
assert_eq!(

tests/sqlparser_databricks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn test_databricks_exists() {
6464
let res = databricks().parse_sql_statements("SELECT EXISTS (");
6565
assert_eq!(
6666
// TODO: improve this error message...
67-
ParserError::ParserError("Expected: an expression:, found: EOF".to_string()),
67+
ParserError::ParserError("Expected: an expression, found: EOF".to_string()),
6868
res.unwrap_err(),
6969
);
7070
}

tests/sqlparser_mssql.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ fn parse_convert() {
487487

488488
let error_sql = "SELECT CONVERT(INT, 'foo',) FROM T";
489489
assert_eq!(
490-
ParserError::ParserError("Expected: an expression:, found: )".to_owned()),
490+
ParserError::ParserError("Expected: an expression, found: )".to_owned()),
491491
ms().parse_sql_statements(error_sql).unwrap_err()
492492
);
493493
}

tests/sqlparser_snowflake.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1230,13 +1230,13 @@ fn parse_snowflake_declare_result_set() {
12301230

12311231
let error_sql = "DECLARE res RESULTSET DEFAULT";
12321232
assert_eq!(
1233-
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
1233+
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
12341234
snowflake().parse_sql_statements(error_sql).unwrap_err()
12351235
);
12361236

12371237
let error_sql = "DECLARE res RESULTSET :=";
12381238
assert_eq!(
1239-
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
1239+
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
12401240
snowflake().parse_sql_statements(error_sql).unwrap_err()
12411241
);
12421242
}
@@ -1328,13 +1328,13 @@ fn parse_snowflake_declare_variable() {
13281328

13291329
let error_sql = "DECLARE profit INT DEFAULT";
13301330
assert_eq!(
1331-
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
1331+
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
13321332
snowflake().parse_sql_statements(error_sql).unwrap_err()
13331333
);
13341334

13351335
let error_sql = "DECLARE profit DEFAULT";
13361336
assert_eq!(
1337-
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
1337+
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
13381338
snowflake().parse_sql_statements(error_sql).unwrap_err()
13391339
);
13401340
}

tests/sqlparser_sqlite.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ fn invalid_empty_list() {
432432
let sql = "SELECT * FROM t1 WHERE a IN (,,)";
433433
let sqlite = sqlite_with_options(ParserOptions::new().with_trailing_commas(true));
434434
assert_eq!(
435-
"sql parser error: Expected: an expression:, found: ,",
435+
"sql parser error: Expected: an expression, found: ,",
436436
sqlite.parse_sql_statements(sql).unwrap_err().to_string()
437437
);
438438
}

0 commit comments

Comments
 (0)