From 3dd54347f1b85b8d300d2383f4f393e0f3371251 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Sun, 21 Apr 2024 22:24:06 -0700 Subject: [PATCH] internal: Use default `Debug` impl for `TokenVec` --- prqlc/prqlc-parser/src/lexer.rs | 109 ++-- prqlc/prqlc-parser/src/lib.rs | 10 +- ...ntegration__queries__lex__aggregation.snap | 80 +-- ...integration__queries__lex__arithmetic.snap | 512 +++++++++--------- .../integration__queries__lex__cast.snap | 74 +-- ...gration__queries__lex__constants_only.snap | 44 +- ...tegration__queries__lex__date_to_text.snap | 330 +++++------ .../integration__queries__lex__distinct.snap | 56 +- ...ntegration__queries__lex__distinct_on.snap | 82 +-- ...tegration__queries__lex__genre_counts.snap | 78 +-- .../integration__queries__lex__group_all.snap | 98 ++-- ...integration__queries__lex__group_sort.snap | 98 ++-- ...__queries__lex__group_sort_limit_take.snap | 112 ++-- ...gration__queries__lex__invoice_totals.snap | 312 +++++------ .../integration__queries__lex__loop_01.snap | 94 ++-- ...ntegration__queries__lex__math_module.snap | 404 +++++++------- .../integration__queries__lex__pipelines.snap | 102 ++-- .../integration__queries__lex__read_csv.snap | 34 +- ...gration__queries__lex__set_ops_remove.snap | 100 ++-- .../integration__queries__lex__sort.snap | 114 ++-- .../integration__queries__lex__switch.snap | 82 +-- .../integration__queries__lex__take.snap | 36 +- ...ntegration__queries__lex__text_module.snap | 258 ++++----- .../integration__queries__lex__window.snap | 146 ++--- 24 files changed, 1715 insertions(+), 1650 deletions(-) diff --git a/prqlc/prqlc-parser/src/lexer.rs b/prqlc/prqlc-parser/src/lexer.rs index ec9bd4eb8fab..f45c8fb68543 100644 --- a/prqlc/prqlc-parser/src/lexer.rs +++ b/prqlc/prqlc-parser/src/lexer.rs @@ -574,17 +574,18 @@ impl std::fmt::Debug for Token { } } +#[derive(Serialize, Deserialize, Debug)] pub struct TokenVec(pub Vec); -impl std::fmt::Debug for TokenVec { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - writeln!(f, "TokenVec (")?; - for token in self.0.iter() { - writeln!(f, " {:?},", token)?; - } - write!(f, ")") - } -} +// impl std::fmt::Debug for TokenVec { +// fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { +// writeln!(f, "TokenVec (")?; +// for token in self.0.iter() { +// writeln!(f, " {:?},", token)?; +// } +// write!(f, ")") +// } +// } #[cfg(test)] mod test { @@ -597,11 +598,13 @@ mod test { assert_debug_snapshot!(TokenVec(lexer().parse(r"5 + \ 3 " ).unwrap()), @r###" - TokenVec ( - 0..1: Literal(Integer(5)), - 2..3: Control('+'), - 3..9: LineWrap([]), - 10..11: Literal(Integer(3)), + TokenVec( + [ + 0..1: Literal(Integer(5)), + 2..3: Control('+'), + 3..9: LineWrap([]), + 10..11: Literal(Integer(3)), + ], ) "###); @@ -611,11 +614,13 @@ mod test { # comment with whitespace \ 3 " ).unwrap()), @r###" - TokenVec ( - 0..1: Literal(Integer(5)), - 2..3: Control('+'), - 3..46: LineWrap([Comment(" comment"), Comment(" comment with whitespace")]), - 47..48: Literal(Integer(3)), + TokenVec( + [ + 0..1: Literal(Integer(5)), + 2..3: Control('+'), + 3..46: LineWrap([Comment(" comment"), Comment(" comment with whitespace")]), + 47..48: Literal(Integer(3)), + ], ) "###); @@ -658,21 +663,25 @@ mod test { #[test] fn debug_display() { assert_debug_snapshot!(TokenVec(lexer().parse("5 + 3").unwrap()), @r###" - TokenVec ( - 0..1: Literal(Integer(5)), - 2..3: Control('+'), - 4..5: Literal(Integer(3)), - ) - "###); + TokenVec( + [ + 0..1: Literal(Integer(5)), + 2..3: Control('+'), + 4..5: Literal(Integer(3)), + ], + ) + "###); } #[test] fn comment() { assert_debug_snapshot!(TokenVec(lexer().parse("# comment\n# second line").unwrap()), @r###" - TokenVec ( - 0..9: Comment(" comment"), - 9..10: NewLine, - 10..23: Comment(" second line"), + TokenVec( + [ + 0..9: Comment(" comment"), + 9..10: NewLine, + 10..23: Comment(" second line"), + ], ) "###); @@ -684,8 +693,10 @@ mod test { #[test] fn doc_comment() { assert_debug_snapshot!(TokenVec(lexer().parse("#! docs").unwrap()), @r###" - TokenVec ( - 0..7: DocComment(" docs"), + TokenVec( + [ + 0..7: DocComment(" docs"), + ], ) "###); } @@ -728,32 +739,40 @@ mod test { #[test] fn range() { assert_debug_snapshot!(TokenVec(lexer().parse("1..2").unwrap()), @r###" - TokenVec ( - 0..1: Literal(Integer(1)), - 1..3: Range { bind_left: true, bind_right: true }, - 3..4: Literal(Integer(2)), + TokenVec( + [ + 0..1: Literal(Integer(1)), + 1..3: Range { bind_left: true, bind_right: true }, + 3..4: Literal(Integer(2)), + ], ) "###); assert_debug_snapshot!(TokenVec(lexer().parse("..2").unwrap()), @r###" - TokenVec ( - 0..2: Range { bind_left: true, bind_right: true }, - 2..3: Literal(Integer(2)), + TokenVec( + [ + 0..2: Range { bind_left: true, bind_right: true }, + 2..3: Literal(Integer(2)), + ], ) "###); assert_debug_snapshot!(TokenVec(lexer().parse("1..").unwrap()), @r###" - TokenVec ( - 0..1: Literal(Integer(1)), - 1..3: Range { bind_left: true, bind_right: true }, + TokenVec( + [ + 0..1: Literal(Integer(1)), + 1..3: Range { bind_left: true, bind_right: true }, + ], ) "###); assert_debug_snapshot!(TokenVec(lexer().parse("in ..5").unwrap()), @r###" - TokenVec ( - 0..2: Ident("in"), - 2..5: Range { bind_left: false, bind_right: true }, - 5..6: Literal(Integer(5)), + TokenVec( + [ + 0..2: Ident("in"), + 2..5: Range { bind_left: false, bind_right: true }, + 5..6: Literal(Integer(5)), + ], ) "###); } diff --git a/prqlc/prqlc-parser/src/lib.rs b/prqlc/prqlc-parser/src/lib.rs index e575aca63378..025c9a75401b 100644 --- a/prqlc/prqlc-parser/src/lib.rs +++ b/prqlc/prqlc-parser/src/lib.rs @@ -242,10 +242,12 @@ fn test_lex_source() { assert_debug_snapshot!(lex_source("5 + 3"), @r###" Ok( - TokenVec ( - 0..1: Literal(Integer(5)), - 2..3: Control('+'), - 4..5: Literal(Integer(3)), + TokenVec( + [ + 0..1: Literal(Integer(5)), + 2..3: Control('+'), + 4..5: Literal(Integer(3)), + ], ), ) "###); diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__aggregation.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__aggregation.snap index f2418a549028..43c2b6b74f84 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__aggregation.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__aggregation.snap @@ -3,43 +3,45 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/aggregation.prql --- -TokenVec ( - 0..12: Comment(" mssql:skip"), - 12..13: NewLine, - 13..25: Comment(" mysql:skip"), - 25..26: NewLine, - 26..43: Comment(" clickhouse:skip"), - 43..44: NewLine, - 44..101: Comment(" glaredb:skip (the string_agg function is not supported)"), - 101..102: NewLine, - 102..106: Ident("from"), - 107..113: Ident("tracks"), - 113..114: NewLine, - 114..120: Ident("filter"), - 121..129: Ident("genre_id"), - 130..132: Eq, - 133..136: Literal(Integer(100)), - 136..137: NewLine, - 137..143: Ident("derive"), - 144..154: Ident("empty_name"), - 155..156: Control('='), - 157..161: Ident("name"), - 162..164: Eq, - 165..167: Literal(String("")), - 167..168: NewLine, - 168..177: Ident("aggregate"), - 178..179: Control('{'), - 179..182: Ident("sum"), - 183..191: Ident("track_id"), - 191..192: Control(','), - 193..205: Ident("concat_array"), - 206..210: Ident("name"), - 210..211: Control(','), - 212..215: Ident("all"), - 216..226: Ident("empty_name"), - 226..227: Control(','), - 228..231: Ident("any"), - 232..242: Ident("empty_name"), - 242..243: Control('}'), - 243..244: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:skip"), + 12..13: NewLine, + 13..25: Comment(" mysql:skip"), + 25..26: NewLine, + 26..43: Comment(" clickhouse:skip"), + 43..44: NewLine, + 44..101: Comment(" glaredb:skip (the string_agg function is not supported)"), + 101..102: NewLine, + 102..106: Ident("from"), + 107..113: Ident("tracks"), + 113..114: NewLine, + 114..120: Ident("filter"), + 121..129: Ident("genre_id"), + 130..132: Eq, + 133..136: Literal(Integer(100)), + 136..137: NewLine, + 137..143: Ident("derive"), + 144..154: Ident("empty_name"), + 155..156: Control('='), + 157..161: Ident("name"), + 162..164: Eq, + 165..167: Literal(String("")), + 167..168: NewLine, + 168..177: Ident("aggregate"), + 178..179: Control('{'), + 179..182: Ident("sum"), + 183..191: Ident("track_id"), + 191..192: Control(','), + 193..205: Ident("concat_array"), + 206..210: Ident("name"), + 210..211: Control(','), + 212..215: Ident("all"), + 216..226: Ident("empty_name"), + 226..227: Control(','), + 228..231: Ident("any"), + 232..242: Ident("empty_name"), + 242..243: Control('}'), + 243..244: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__arithmetic.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__arithmetic.snap index 90d6c4cf6700..dec80d28835a 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__arithmetic.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__arithmetic.snap @@ -3,259 +3,261 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/arithmetic.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..19: Control('['), - 19..20: NewLine, - 24..25: Control('{'), - 26..28: Ident("id"), - 29..30: Control('='), - 31..32: Literal(Integer(1)), - 32..33: Control(','), - 34..39: Ident("x_int"), - 40..41: Control('='), - 43..45: Literal(Integer(13)), - 45..46: Control(','), - 47..54: Ident("x_float"), - 55..56: Control('='), - 58..62: Literal(Float(13.0)), - 62..63: Control(','), - 64..69: Ident("k_int"), - 70..71: Control('='), - 73..74: Literal(Integer(5)), - 74..75: Control(','), - 76..83: Ident("k_float"), - 84..85: Control('='), - 87..90: Literal(Float(5.0)), - 91..92: Control('}'), - 92..93: Control(','), - 93..94: NewLine, - 98..99: Control('{'), - 100..102: Ident("id"), - 103..104: Control('='), - 105..106: Literal(Integer(2)), - 106..107: Control(','), - 108..113: Ident("x_int"), - 114..115: Control('='), - 116..117: Control('-'), - 117..119: Literal(Integer(13)), - 119..120: Control(','), - 121..128: Ident("x_float"), - 129..130: Control('='), - 131..132: Control('-'), - 132..136: Literal(Float(13.0)), - 136..137: Control(','), - 138..143: Ident("k_int"), - 144..145: Control('='), - 147..148: Literal(Integer(5)), - 148..149: Control(','), - 150..157: Ident("k_float"), - 158..159: Control('='), - 161..164: Literal(Float(5.0)), - 165..166: Control('}'), - 166..167: Control(','), - 167..168: NewLine, - 172..173: Control('{'), - 174..176: Ident("id"), - 177..178: Control('='), - 179..180: Literal(Integer(3)), - 180..181: Control(','), - 182..187: Ident("x_int"), - 188..189: Control('='), - 191..193: Literal(Integer(13)), - 193..194: Control(','), - 195..202: Ident("x_float"), - 203..204: Control('='), - 206..210: Literal(Float(13.0)), - 210..211: Control(','), - 212..217: Ident("k_int"), - 218..219: Control('='), - 220..221: Control('-'), - 221..222: Literal(Integer(5)), - 222..223: Control(','), - 224..231: Ident("k_float"), - 232..233: Control('='), - 234..235: Control('-'), - 235..238: Literal(Float(5.0)), - 239..240: Control('}'), - 240..241: Control(','), - 241..242: NewLine, - 246..247: Control('{'), - 248..250: Ident("id"), - 251..252: Control('='), - 253..254: Literal(Integer(4)), - 254..255: Control(','), - 256..261: Ident("x_int"), - 262..263: Control('='), - 264..265: Control('-'), - 265..267: Literal(Integer(13)), - 267..268: Control(','), - 269..276: Ident("x_float"), - 277..278: Control('='), - 279..280: Control('-'), - 280..284: Literal(Float(13.0)), - 284..285: Control(','), - 286..291: Ident("k_int"), - 292..293: Control('='), - 294..295: Control('-'), - 295..296: Literal(Integer(5)), - 296..297: Control(','), - 298..305: Ident("k_float"), - 306..307: Control('='), - 308..309: Control('-'), - 309..312: Literal(Float(5.0)), - 313..314: Control('}'), - 314..315: Control(','), - 315..316: NewLine, - 316..317: Control(']'), - 317..318: NewLine, - 318..324: Ident("select"), - 325..326: Control('{'), - 326..327: NewLine, - 331..333: Ident("id"), - 333..334: Control(','), - 334..335: NewLine, - 335..336: NewLine, - 340..345: Ident("x_int"), - 346..347: Control('/'), - 348..353: Ident("k_int"), - 353..354: Control(','), - 354..355: NewLine, - 359..364: Ident("x_int"), - 365..366: Control('/'), - 367..374: Ident("k_float"), - 374..375: Control(','), - 375..376: NewLine, - 380..387: Ident("x_float"), - 388..389: Control('/'), - 390..395: Ident("k_int"), - 395..396: Control(','), - 396..397: NewLine, - 401..408: Ident("x_float"), - 409..410: Control('/'), - 411..418: Ident("k_float"), - 418..419: Control(','), - 419..420: NewLine, - 420..421: NewLine, - 425..429: Ident("q_ii"), - 430..431: Control('='), - 432..437: Ident("x_int"), - 438..440: DivInt, - 441..446: Ident("k_int"), - 446..447: Control(','), - 447..448: NewLine, - 452..456: Ident("q_if"), - 457..458: Control('='), - 459..464: Ident("x_int"), - 465..467: DivInt, - 468..475: Ident("k_float"), - 475..476: Control(','), - 476..477: NewLine, - 481..485: Ident("q_fi"), - 486..487: Control('='), - 488..495: Ident("x_float"), - 496..498: DivInt, - 499..504: Ident("k_int"), - 504..505: Control(','), - 505..506: NewLine, - 510..514: Ident("q_ff"), - 515..516: Control('='), - 517..524: Ident("x_float"), - 525..527: DivInt, - 528..535: Ident("k_float"), - 535..536: Control(','), - 536..537: NewLine, - 537..538: NewLine, - 542..546: Ident("r_ii"), - 547..548: Control('='), - 549..554: Ident("x_int"), - 555..556: Control('%'), - 557..562: Ident("k_int"), - 562..563: Control(','), - 563..564: NewLine, - 568..572: Ident("r_if"), - 573..574: Control('='), - 575..580: Ident("x_int"), - 581..582: Control('%'), - 583..590: Ident("k_float"), - 590..591: Control(','), - 591..592: NewLine, - 596..600: Ident("r_fi"), - 601..602: Control('='), - 603..610: Ident("x_float"), - 611..612: Control('%'), - 613..618: Ident("k_int"), - 618..619: Control(','), - 619..620: NewLine, - 624..628: Ident("r_ff"), - 629..630: Control('='), - 631..638: Ident("x_float"), - 639..640: Control('%'), - 641..648: Ident("k_float"), - 648..649: Control(','), - 649..650: NewLine, - 650..651: NewLine, - 655..656: Control('('), - 656..660: Ident("q_ii"), - 661..662: Control('*'), - 663..668: Ident("k_int"), - 669..670: Control('+'), - 671..675: Ident("r_ii"), - 676..677: Control('|'), - 678..682: Ident("math"), - 682..683: Control('.'), - 683..688: Ident("round"), - 689..690: Literal(Integer(0)), - 690..691: Control(')'), - 691..692: Control(','), - 692..693: NewLine, - 697..698: Control('('), - 698..702: Ident("q_if"), - 703..704: Control('*'), - 705..712: Ident("k_float"), - 713..714: Control('+'), - 715..719: Ident("r_if"), - 720..721: Control('|'), - 722..726: Ident("math"), - 726..727: Control('.'), - 727..732: Ident("round"), - 733..734: Literal(Integer(0)), - 734..735: Control(')'), - 735..736: Control(','), - 736..737: NewLine, - 741..742: Control('('), - 742..746: Ident("q_fi"), - 747..748: Control('*'), - 749..754: Ident("k_int"), - 755..756: Control('+'), - 757..761: Ident("r_fi"), - 762..763: Control('|'), - 764..768: Ident("math"), - 768..769: Control('.'), - 769..774: Ident("round"), - 775..776: Literal(Integer(0)), - 776..777: Control(')'), - 777..778: Control(','), - 778..779: NewLine, - 783..784: Control('('), - 784..788: Ident("q_ff"), - 789..790: Control('*'), - 791..798: Ident("k_float"), - 799..800: Control('+'), - 801..805: Ident("r_ff"), - 806..807: Control('|'), - 808..812: Ident("math"), - 812..813: Control('.'), - 813..818: Ident("round"), - 819..820: Literal(Integer(0)), - 820..821: Control(')'), - 821..822: Control(','), - 822..823: NewLine, - 823..824: Control('}'), - 824..825: NewLine, - 825..829: Ident("sort"), - 830..832: Ident("id"), - 832..833: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..19: Control('['), + 19..20: NewLine, + 24..25: Control('{'), + 26..28: Ident("id"), + 29..30: Control('='), + 31..32: Literal(Integer(1)), + 32..33: Control(','), + 34..39: Ident("x_int"), + 40..41: Control('='), + 43..45: Literal(Integer(13)), + 45..46: Control(','), + 47..54: Ident("x_float"), + 55..56: Control('='), + 58..62: Literal(Float(13.0)), + 62..63: Control(','), + 64..69: Ident("k_int"), + 70..71: Control('='), + 73..74: Literal(Integer(5)), + 74..75: Control(','), + 76..83: Ident("k_float"), + 84..85: Control('='), + 87..90: Literal(Float(5.0)), + 91..92: Control('}'), + 92..93: Control(','), + 93..94: NewLine, + 98..99: Control('{'), + 100..102: Ident("id"), + 103..104: Control('='), + 105..106: Literal(Integer(2)), + 106..107: Control(','), + 108..113: Ident("x_int"), + 114..115: Control('='), + 116..117: Control('-'), + 117..119: Literal(Integer(13)), + 119..120: Control(','), + 121..128: Ident("x_float"), + 129..130: Control('='), + 131..132: Control('-'), + 132..136: Literal(Float(13.0)), + 136..137: Control(','), + 138..143: Ident("k_int"), + 144..145: Control('='), + 147..148: Literal(Integer(5)), + 148..149: Control(','), + 150..157: Ident("k_float"), + 158..159: Control('='), + 161..164: Literal(Float(5.0)), + 165..166: Control('}'), + 166..167: Control(','), + 167..168: NewLine, + 172..173: Control('{'), + 174..176: Ident("id"), + 177..178: Control('='), + 179..180: Literal(Integer(3)), + 180..181: Control(','), + 182..187: Ident("x_int"), + 188..189: Control('='), + 191..193: Literal(Integer(13)), + 193..194: Control(','), + 195..202: Ident("x_float"), + 203..204: Control('='), + 206..210: Literal(Float(13.0)), + 210..211: Control(','), + 212..217: Ident("k_int"), + 218..219: Control('='), + 220..221: Control('-'), + 221..222: Literal(Integer(5)), + 222..223: Control(','), + 224..231: Ident("k_float"), + 232..233: Control('='), + 234..235: Control('-'), + 235..238: Literal(Float(5.0)), + 239..240: Control('}'), + 240..241: Control(','), + 241..242: NewLine, + 246..247: Control('{'), + 248..250: Ident("id"), + 251..252: Control('='), + 253..254: Literal(Integer(4)), + 254..255: Control(','), + 256..261: Ident("x_int"), + 262..263: Control('='), + 264..265: Control('-'), + 265..267: Literal(Integer(13)), + 267..268: Control(','), + 269..276: Ident("x_float"), + 277..278: Control('='), + 279..280: Control('-'), + 280..284: Literal(Float(13.0)), + 284..285: Control(','), + 286..291: Ident("k_int"), + 292..293: Control('='), + 294..295: Control('-'), + 295..296: Literal(Integer(5)), + 296..297: Control(','), + 298..305: Ident("k_float"), + 306..307: Control('='), + 308..309: Control('-'), + 309..312: Literal(Float(5.0)), + 313..314: Control('}'), + 314..315: Control(','), + 315..316: NewLine, + 316..317: Control(']'), + 317..318: NewLine, + 318..324: Ident("select"), + 325..326: Control('{'), + 326..327: NewLine, + 331..333: Ident("id"), + 333..334: Control(','), + 334..335: NewLine, + 335..336: NewLine, + 340..345: Ident("x_int"), + 346..347: Control('/'), + 348..353: Ident("k_int"), + 353..354: Control(','), + 354..355: NewLine, + 359..364: Ident("x_int"), + 365..366: Control('/'), + 367..374: Ident("k_float"), + 374..375: Control(','), + 375..376: NewLine, + 380..387: Ident("x_float"), + 388..389: Control('/'), + 390..395: Ident("k_int"), + 395..396: Control(','), + 396..397: NewLine, + 401..408: Ident("x_float"), + 409..410: Control('/'), + 411..418: Ident("k_float"), + 418..419: Control(','), + 419..420: NewLine, + 420..421: NewLine, + 425..429: Ident("q_ii"), + 430..431: Control('='), + 432..437: Ident("x_int"), + 438..440: DivInt, + 441..446: Ident("k_int"), + 446..447: Control(','), + 447..448: NewLine, + 452..456: Ident("q_if"), + 457..458: Control('='), + 459..464: Ident("x_int"), + 465..467: DivInt, + 468..475: Ident("k_float"), + 475..476: Control(','), + 476..477: NewLine, + 481..485: Ident("q_fi"), + 486..487: Control('='), + 488..495: Ident("x_float"), + 496..498: DivInt, + 499..504: Ident("k_int"), + 504..505: Control(','), + 505..506: NewLine, + 510..514: Ident("q_ff"), + 515..516: Control('='), + 517..524: Ident("x_float"), + 525..527: DivInt, + 528..535: Ident("k_float"), + 535..536: Control(','), + 536..537: NewLine, + 537..538: NewLine, + 542..546: Ident("r_ii"), + 547..548: Control('='), + 549..554: Ident("x_int"), + 555..556: Control('%'), + 557..562: Ident("k_int"), + 562..563: Control(','), + 563..564: NewLine, + 568..572: Ident("r_if"), + 573..574: Control('='), + 575..580: Ident("x_int"), + 581..582: Control('%'), + 583..590: Ident("k_float"), + 590..591: Control(','), + 591..592: NewLine, + 596..600: Ident("r_fi"), + 601..602: Control('='), + 603..610: Ident("x_float"), + 611..612: Control('%'), + 613..618: Ident("k_int"), + 618..619: Control(','), + 619..620: NewLine, + 624..628: Ident("r_ff"), + 629..630: Control('='), + 631..638: Ident("x_float"), + 639..640: Control('%'), + 641..648: Ident("k_float"), + 648..649: Control(','), + 649..650: NewLine, + 650..651: NewLine, + 655..656: Control('('), + 656..660: Ident("q_ii"), + 661..662: Control('*'), + 663..668: Ident("k_int"), + 669..670: Control('+'), + 671..675: Ident("r_ii"), + 676..677: Control('|'), + 678..682: Ident("math"), + 682..683: Control('.'), + 683..688: Ident("round"), + 689..690: Literal(Integer(0)), + 690..691: Control(')'), + 691..692: Control(','), + 692..693: NewLine, + 697..698: Control('('), + 698..702: Ident("q_if"), + 703..704: Control('*'), + 705..712: Ident("k_float"), + 713..714: Control('+'), + 715..719: Ident("r_if"), + 720..721: Control('|'), + 722..726: Ident("math"), + 726..727: Control('.'), + 727..732: Ident("round"), + 733..734: Literal(Integer(0)), + 734..735: Control(')'), + 735..736: Control(','), + 736..737: NewLine, + 741..742: Control('('), + 742..746: Ident("q_fi"), + 747..748: Control('*'), + 749..754: Ident("k_int"), + 755..756: Control('+'), + 757..761: Ident("r_fi"), + 762..763: Control('|'), + 764..768: Ident("math"), + 768..769: Control('.'), + 769..774: Ident("round"), + 775..776: Literal(Integer(0)), + 776..777: Control(')'), + 777..778: Control(','), + 778..779: NewLine, + 783..784: Control('('), + 784..788: Ident("q_ff"), + 789..790: Control('*'), + 791..798: Ident("k_float"), + 799..800: Control('+'), + 801..805: Ident("r_ff"), + 806..807: Control('|'), + 808..812: Ident("math"), + 812..813: Control('.'), + 813..818: Ident("round"), + 819..820: Literal(Integer(0)), + 820..821: Control(')'), + 821..822: Control(','), + 822..823: NewLine, + 823..824: Control('}'), + 824..825: NewLine, + 825..829: Ident("sort"), + 830..832: Ident("id"), + 832..833: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__cast.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__cast.snap index f3bba36634ce..b2717dbc0ce1 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__cast.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__cast.snap @@ -3,40 +3,42 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/cast.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..24: Ident("tracks"), - 24..25: NewLine, - 25..29: Ident("sort"), - 30..31: Control('{'), - 31..32: Control('-'), - 32..37: Ident("bytes"), - 37..38: Control('}'), - 38..39: NewLine, - 39..45: Ident("select"), - 46..47: Control('{'), - 47..48: NewLine, - 52..56: Ident("name"), - 56..57: Control(','), - 57..58: NewLine, - 62..65: Ident("bin"), - 66..67: Control('='), - 68..69: Control('('), - 69..70: Control('('), - 70..78: Ident("album_id"), - 79..80: Control('|'), - 81..83: Ident("as"), - 84..88: Ident("REAL"), - 88..89: Control(')'), - 90..91: Control('*'), - 92..94: Literal(Integer(99)), - 94..95: Control(')'), - 95..96: NewLine, - 96..97: Control('}'), - 97..98: NewLine, - 98..102: Ident("take"), - 103..105: Literal(Integer(20)), - 105..106: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..24: Ident("tracks"), + 24..25: NewLine, + 25..29: Ident("sort"), + 30..31: Control('{'), + 31..32: Control('-'), + 32..37: Ident("bytes"), + 37..38: Control('}'), + 38..39: NewLine, + 39..45: Ident("select"), + 46..47: Control('{'), + 47..48: NewLine, + 52..56: Ident("name"), + 56..57: Control(','), + 57..58: NewLine, + 62..65: Ident("bin"), + 66..67: Control('='), + 68..69: Control('('), + 69..70: Control('('), + 70..78: Ident("album_id"), + 79..80: Control('|'), + 81..83: Ident("as"), + 84..88: Ident("REAL"), + 88..89: Control(')'), + 90..91: Control('*'), + 92..94: Literal(Integer(99)), + 94..95: Control(')'), + 95..96: NewLine, + 96..97: Control('}'), + 97..98: NewLine, + 98..102: Ident("take"), + 103..105: Literal(Integer(20)), + 105..106: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__constants_only.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__constants_only.snap index 4237fc01c911..2bcb7fd14f48 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__constants_only.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__constants_only.snap @@ -3,25 +3,27 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/constants_only.prql --- -TokenVec ( - 0..4: Ident("from"), - 5..11: Ident("genres"), - 11..12: NewLine, - 12..16: Ident("take"), - 17..19: Literal(Integer(10)), - 19..20: NewLine, - 20..26: Ident("filter"), - 27..31: Literal(Boolean(true)), - 31..32: NewLine, - 32..36: Ident("take"), - 37..39: Literal(Integer(20)), - 39..40: NewLine, - 40..46: Ident("filter"), - 47..51: Literal(Boolean(true)), - 51..52: NewLine, - 52..58: Ident("select"), - 59..60: Ident("d"), - 61..62: Control('='), - 63..65: Literal(Integer(10)), - 65..66: NewLine, +TokenVec( + [ + 0..4: Ident("from"), + 5..11: Ident("genres"), + 11..12: NewLine, + 12..16: Ident("take"), + 17..19: Literal(Integer(10)), + 19..20: NewLine, + 20..26: Ident("filter"), + 27..31: Literal(Boolean(true)), + 31..32: NewLine, + 32..36: Ident("take"), + 37..39: Literal(Integer(20)), + 39..40: NewLine, + 40..46: Ident("filter"), + 47..51: Literal(Boolean(true)), + 51..52: NewLine, + 52..58: Ident("select"), + 59..60: Ident("d"), + 61..62: Control('='), + 63..65: Literal(Integer(10)), + 65..66: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__date_to_text.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__date_to_text.snap index 31178d57118d..4147aabfe110 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__date_to_text.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__date_to_text.snap @@ -3,168 +3,170 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/date_to_text.prql --- -TokenVec ( - 0..14: Comment(" generic:skip"), - 14..15: NewLine, - 15..29: Comment(" glaredb:skip"), - 29..30: NewLine, - 30..43: Comment(" sqlite:skip"), - 43..44: NewLine, - 44..56: Comment(" mssql:test"), - 56..57: NewLine, - 57..61: Ident("from"), - 62..70: Ident("invoices"), - 70..71: NewLine, - 71..75: Ident("take"), - 76..78: Literal(Integer(20)), - 78..79: NewLine, - 79..85: Ident("select"), - 86..87: Control('{'), - 87..88: NewLine, - 92..94: Ident("d1"), - 95..96: Control('='), - 97..98: Control('('), - 98..110: Ident("invoice_date"), - 111..112: Control('|'), - 113..117: Ident("date"), - 117..118: Control('.'), - 118..125: Ident("to_text"), - 126..136: Literal(String("%Y/%m/%d")), - 136..137: Control(')'), - 137..138: Control(','), - 138..139: NewLine, - 143..145: Ident("d2"), - 146..147: Control('='), - 148..149: Control('('), - 149..161: Ident("invoice_date"), - 162..163: Control('|'), - 164..168: Ident("date"), - 168..169: Control('.'), - 169..176: Ident("to_text"), - 177..181: Literal(String("%F")), - 181..182: Control(')'), - 182..183: Control(','), - 183..184: NewLine, - 188..190: Ident("d3"), - 191..192: Control('='), - 193..194: Control('('), - 194..206: Ident("invoice_date"), - 207..208: Control('|'), - 209..213: Ident("date"), - 213..214: Control('.'), - 214..221: Ident("to_text"), - 222..226: Literal(String("%D")), - 226..227: Control(')'), - 227..228: Control(','), - 228..229: NewLine, - 233..235: Ident("d4"), - 236..237: Control('='), - 238..239: Control('('), - 239..251: Ident("invoice_date"), - 252..253: Control('|'), - 254..258: Ident("date"), - 258..259: Control('.'), - 259..266: Ident("to_text"), - 267..280: Literal(String("%H:%M:%S.%f")), - 280..281: Control(')'), - 281..282: Control(','), - 282..283: NewLine, - 287..289: Ident("d5"), - 290..291: Control('='), - 292..293: Control('('), - 293..305: Ident("invoice_date"), - 306..307: Control('|'), - 308..312: Ident("date"), - 312..313: Control('.'), - 313..320: Ident("to_text"), - 321..325: Literal(String("%r")), - 325..326: Control(')'), - 326..327: Control(','), - 327..328: NewLine, - 332..334: Ident("d6"), - 335..336: Control('='), - 337..338: Control('('), - 338..350: Ident("invoice_date"), - 351..352: Control('|'), - 353..357: Ident("date"), - 357..358: Control('.'), - 358..365: Ident("to_text"), - 366..380: Literal(String("%A %B %-d %Y")), - 380..381: Control(')'), - 381..382: Control(','), - 382..383: NewLine, - 387..389: Ident("d7"), - 390..391: Control('='), - 392..393: Control('('), - 393..405: Ident("invoice_date"), - 406..407: Control('|'), - 408..412: Ident("date"), - 412..413: Control('.'), - 413..420: Ident("to_text"), - 421..451: Literal(String("%a, %-d %b %Y at %I:%M:%S %p")), - 451..452: Control(')'), - 452..453: Control(','), - 453..454: NewLine, - 458..460: Ident("d8"), - 461..462: Control('='), - 463..464: Control('('), - 464..476: Ident("invoice_date"), - 477..478: Control('|'), - 479..483: Ident("date"), - 483..484: Control('.'), - 484..491: Ident("to_text"), - 492..496: Literal(String("%+")), - 496..497: Control(')'), - 497..498: Control(','), - 498..499: NewLine, - 503..505: Ident("d9"), - 506..507: Control('='), - 508..509: Control('('), - 509..521: Ident("invoice_date"), - 522..523: Control('|'), - 524..528: Ident("date"), - 528..529: Control('.'), - 529..536: Ident("to_text"), - 537..549: Literal(String("%-d/%-m/%y")), - 549..550: Control(')'), - 550..551: Control(','), - 551..552: NewLine, - 556..559: Ident("d10"), - 560..561: Control('='), - 562..563: Control('('), - 563..575: Ident("invoice_date"), - 576..577: Control('|'), - 578..582: Ident("date"), - 582..583: Control('.'), - 583..590: Ident("to_text"), - 591..603: Literal(String("%-Hh %Mmin")), - 603..604: Control(')'), - 604..605: Control(','), - 605..606: NewLine, - 610..613: Ident("d11"), - 614..615: Control('='), - 616..617: Control('('), - 617..629: Ident("invoice_date"), - 630..631: Control('|'), - 632..636: Ident("date"), - 636..637: Control('.'), - 637..644: Ident("to_text"), - 645..654: Literal(String("%M'%S\"")), - 654..655: Control(')'), - 655..656: Control(','), - 656..657: NewLine, - 661..664: Ident("d12"), - 665..666: Control('='), - 667..668: Control('('), - 668..680: Ident("invoice_date"), - 681..682: Control('|'), - 683..687: Ident("date"), - 687..688: Control('.'), - 688..695: Ident("to_text"), - 696..714: Literal(String("100%% in %d days")), - 714..715: Control(')'), - 715..716: Control(','), - 716..717: NewLine, - 717..718: Control('}'), - 718..719: NewLine, +TokenVec( + [ + 0..14: Comment(" generic:skip"), + 14..15: NewLine, + 15..29: Comment(" glaredb:skip"), + 29..30: NewLine, + 30..43: Comment(" sqlite:skip"), + 43..44: NewLine, + 44..56: Comment(" mssql:test"), + 56..57: NewLine, + 57..61: Ident("from"), + 62..70: Ident("invoices"), + 70..71: NewLine, + 71..75: Ident("take"), + 76..78: Literal(Integer(20)), + 78..79: NewLine, + 79..85: Ident("select"), + 86..87: Control('{'), + 87..88: NewLine, + 92..94: Ident("d1"), + 95..96: Control('='), + 97..98: Control('('), + 98..110: Ident("invoice_date"), + 111..112: Control('|'), + 113..117: Ident("date"), + 117..118: Control('.'), + 118..125: Ident("to_text"), + 126..136: Literal(String("%Y/%m/%d")), + 136..137: Control(')'), + 137..138: Control(','), + 138..139: NewLine, + 143..145: Ident("d2"), + 146..147: Control('='), + 148..149: Control('('), + 149..161: Ident("invoice_date"), + 162..163: Control('|'), + 164..168: Ident("date"), + 168..169: Control('.'), + 169..176: Ident("to_text"), + 177..181: Literal(String("%F")), + 181..182: Control(')'), + 182..183: Control(','), + 183..184: NewLine, + 188..190: Ident("d3"), + 191..192: Control('='), + 193..194: Control('('), + 194..206: Ident("invoice_date"), + 207..208: Control('|'), + 209..213: Ident("date"), + 213..214: Control('.'), + 214..221: Ident("to_text"), + 222..226: Literal(String("%D")), + 226..227: Control(')'), + 227..228: Control(','), + 228..229: NewLine, + 233..235: Ident("d4"), + 236..237: Control('='), + 238..239: Control('('), + 239..251: Ident("invoice_date"), + 252..253: Control('|'), + 254..258: Ident("date"), + 258..259: Control('.'), + 259..266: Ident("to_text"), + 267..280: Literal(String("%H:%M:%S.%f")), + 280..281: Control(')'), + 281..282: Control(','), + 282..283: NewLine, + 287..289: Ident("d5"), + 290..291: Control('='), + 292..293: Control('('), + 293..305: Ident("invoice_date"), + 306..307: Control('|'), + 308..312: Ident("date"), + 312..313: Control('.'), + 313..320: Ident("to_text"), + 321..325: Literal(String("%r")), + 325..326: Control(')'), + 326..327: Control(','), + 327..328: NewLine, + 332..334: Ident("d6"), + 335..336: Control('='), + 337..338: Control('('), + 338..350: Ident("invoice_date"), + 351..352: Control('|'), + 353..357: Ident("date"), + 357..358: Control('.'), + 358..365: Ident("to_text"), + 366..380: Literal(String("%A %B %-d %Y")), + 380..381: Control(')'), + 381..382: Control(','), + 382..383: NewLine, + 387..389: Ident("d7"), + 390..391: Control('='), + 392..393: Control('('), + 393..405: Ident("invoice_date"), + 406..407: Control('|'), + 408..412: Ident("date"), + 412..413: Control('.'), + 413..420: Ident("to_text"), + 421..451: Literal(String("%a, %-d %b %Y at %I:%M:%S %p")), + 451..452: Control(')'), + 452..453: Control(','), + 453..454: NewLine, + 458..460: Ident("d8"), + 461..462: Control('='), + 463..464: Control('('), + 464..476: Ident("invoice_date"), + 477..478: Control('|'), + 479..483: Ident("date"), + 483..484: Control('.'), + 484..491: Ident("to_text"), + 492..496: Literal(String("%+")), + 496..497: Control(')'), + 497..498: Control(','), + 498..499: NewLine, + 503..505: Ident("d9"), + 506..507: Control('='), + 508..509: Control('('), + 509..521: Ident("invoice_date"), + 522..523: Control('|'), + 524..528: Ident("date"), + 528..529: Control('.'), + 529..536: Ident("to_text"), + 537..549: Literal(String("%-d/%-m/%y")), + 549..550: Control(')'), + 550..551: Control(','), + 551..552: NewLine, + 556..559: Ident("d10"), + 560..561: Control('='), + 562..563: Control('('), + 563..575: Ident("invoice_date"), + 576..577: Control('|'), + 578..582: Ident("date"), + 582..583: Control('.'), + 583..590: Ident("to_text"), + 591..603: Literal(String("%-Hh %Mmin")), + 603..604: Control(')'), + 604..605: Control(','), + 605..606: NewLine, + 610..613: Ident("d11"), + 614..615: Control('='), + 616..617: Control('('), + 617..629: Ident("invoice_date"), + 630..631: Control('|'), + 632..636: Ident("date"), + 636..637: Control('.'), + 637..644: Ident("to_text"), + 645..654: Literal(String("%M'%S\"")), + 654..655: Control(')'), + 655..656: Control(','), + 656..657: NewLine, + 661..664: Ident("d12"), + 665..666: Control('='), + 667..668: Control('('), + 668..680: Ident("invoice_date"), + 681..682: Control('|'), + 683..687: Ident("date"), + 687..688: Control('.'), + 688..695: Ident("to_text"), + 696..714: Literal(String("100%% in %d days")), + 714..715: Control(')'), + 715..716: Control(','), + 716..717: NewLine, + 717..718: Control('}'), + 718..719: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct.snap index fd1049b2f6fd..5fb2718c3ba4 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct.snap @@ -3,31 +3,33 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/distinct.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..24: Ident("tracks"), - 24..25: NewLine, - 25..31: Ident("select"), - 32..33: Control('{'), - 33..41: Ident("album_id"), - 41..42: Control(','), - 43..51: Ident("genre_id"), - 51..52: Control('}'), - 52..53: NewLine, - 53..58: Ident("group"), - 59..65: Ident("tracks"), - 65..66: Control('.'), - 66..67: Control('*'), - 68..69: Control('('), - 69..73: Ident("take"), - 74..75: Literal(Integer(1)), - 75..76: Control(')'), - 76..77: NewLine, - 77..81: Ident("sort"), - 82..88: Ident("tracks"), - 88..89: Control('.'), - 89..90: Control('*'), - 90..91: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..24: Ident("tracks"), + 24..25: NewLine, + 25..31: Ident("select"), + 32..33: Control('{'), + 33..41: Ident("album_id"), + 41..42: Control(','), + 43..51: Ident("genre_id"), + 51..52: Control('}'), + 52..53: NewLine, + 53..58: Ident("group"), + 59..65: Ident("tracks"), + 65..66: Control('.'), + 66..67: Control('*'), + 68..69: Control('('), + 69..73: Ident("take"), + 74..75: Literal(Integer(1)), + 75..76: Control(')'), + 76..77: NewLine, + 77..81: Ident("sort"), + 82..88: Ident("tracks"), + 88..89: Control('.'), + 89..90: Control('*'), + 90..91: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct_on.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct_on.snap index 16803e327c04..8de2a6d1c581 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct_on.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__distinct_on.snap @@ -3,44 +3,46 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/distinct_on.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..24: Ident("tracks"), - 24..25: NewLine, - 25..31: Ident("select"), - 32..33: Control('{'), - 33..41: Ident("genre_id"), - 41..42: Control(','), - 43..56: Ident("media_type_id"), - 56..57: Control(','), - 58..66: Ident("album_id"), - 66..67: Control('}'), - 67..68: NewLine, - 68..73: Ident("group"), - 74..75: Control('{'), - 75..83: Ident("genre_id"), - 83..84: Control(','), - 85..98: Ident("media_type_id"), - 98..99: Control('}'), - 100..101: Control('('), - 101..105: Ident("sort"), - 106..107: Control('{'), - 107..108: Control('-'), - 108..116: Ident("album_id"), - 116..117: Control('}'), - 118..119: Control('|'), - 120..124: Ident("take"), - 125..126: Literal(Integer(1)), - 126..127: Control(')'), - 127..128: NewLine, - 128..132: Ident("sort"), - 133..134: Control('{'), - 134..135: Control('-'), - 135..143: Ident("genre_id"), - 143..144: Control(','), - 145..158: Ident("media_type_id"), - 158..159: Control('}'), - 159..160: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..24: Ident("tracks"), + 24..25: NewLine, + 25..31: Ident("select"), + 32..33: Control('{'), + 33..41: Ident("genre_id"), + 41..42: Control(','), + 43..56: Ident("media_type_id"), + 56..57: Control(','), + 58..66: Ident("album_id"), + 66..67: Control('}'), + 67..68: NewLine, + 68..73: Ident("group"), + 74..75: Control('{'), + 75..83: Ident("genre_id"), + 83..84: Control(','), + 85..98: Ident("media_type_id"), + 98..99: Control('}'), + 100..101: Control('('), + 101..105: Ident("sort"), + 106..107: Control('{'), + 107..108: Control('-'), + 108..116: Ident("album_id"), + 116..117: Control('}'), + 118..119: Control('|'), + 120..124: Ident("take"), + 125..126: Literal(Integer(1)), + 126..127: Control(')'), + 127..128: NewLine, + 128..132: Ident("sort"), + 133..134: Control('{'), + 134..135: Control('-'), + 135..143: Ident("genre_id"), + 143..144: Control(','), + 145..158: Ident("media_type_id"), + 158..159: Control('}'), + 159..160: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__genre_counts.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__genre_counts.snap index 1ef6e90b147c..d196e9c6719d 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__genre_counts.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__genre_counts.snap @@ -3,42 +3,44 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/genre_counts.prql --- -TokenVec ( - 0..103: Comment(" clickhouse:skip (ClickHouse prefers aliases to column names https://github.com/PRQL/prql/issues/2827)"), - 103..104: NewLine, - 104..116: Comment(" mssql:test"), - 116..117: NewLine, - 117..120: Keyword("let"), - 121..132: Ident("genre_count"), - 133..134: Control('='), - 135..136: Control('('), - 136..137: NewLine, - 141..145: Ident("from"), - 146..152: Ident("genres"), - 152..153: NewLine, - 157..166: Ident("aggregate"), - 167..168: Control('{'), - 168..169: Ident("a"), - 170..171: Control('='), - 172..177: Ident("count"), - 178..182: Ident("name"), - 182..183: Control('}'), - 183..184: NewLine, - 184..185: Control(')'), - 185..186: NewLine, - 186..187: NewLine, - 187..191: Ident("from"), - 192..203: Ident("genre_count"), - 203..204: NewLine, - 204..210: Ident("filter"), - 211..212: Ident("a"), - 213..214: Control('>'), - 215..216: Literal(Integer(0)), - 216..217: NewLine, - 217..223: Ident("select"), - 224..225: Ident("a"), - 226..227: Control('='), - 228..229: Control('-'), - 229..230: Ident("a"), - 230..231: NewLine, +TokenVec( + [ + 0..103: Comment(" clickhouse:skip (ClickHouse prefers aliases to column names https://github.com/PRQL/prql/issues/2827)"), + 103..104: NewLine, + 104..116: Comment(" mssql:test"), + 116..117: NewLine, + 117..120: Keyword("let"), + 121..132: Ident("genre_count"), + 133..134: Control('='), + 135..136: Control('('), + 136..137: NewLine, + 141..145: Ident("from"), + 146..152: Ident("genres"), + 152..153: NewLine, + 157..166: Ident("aggregate"), + 167..168: Control('{'), + 168..169: Ident("a"), + 170..171: Control('='), + 172..177: Ident("count"), + 178..182: Ident("name"), + 182..183: Control('}'), + 183..184: NewLine, + 184..185: Control(')'), + 185..186: NewLine, + 186..187: NewLine, + 187..191: Ident("from"), + 192..203: Ident("genre_count"), + 203..204: NewLine, + 204..210: Ident("filter"), + 211..212: Ident("a"), + 213..214: Control('>'), + 215..216: Literal(Integer(0)), + 216..217: NewLine, + 217..223: Ident("select"), + 224..225: Ident("a"), + 226..227: Control('='), + 228..229: Control('-'), + 229..230: Ident("a"), + 230..231: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_all.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_all.snap index c406d25d358c..c40aa93517ea 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_all.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_all.snap @@ -3,52 +3,54 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/group_all.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..19: Ident("a"), - 19..20: Control('='), - 20..26: Ident("albums"), - 26..27: NewLine, - 27..31: Ident("take"), - 32..34: Literal(Integer(10)), - 34..35: NewLine, - 35..39: Ident("join"), - 40..46: Ident("tracks"), - 47..48: Control('('), - 48..50: Eq, - 50..58: Ident("album_id"), - 58..59: Control(')'), - 59..60: NewLine, - 60..65: Ident("group"), - 66..67: Control('{'), - 67..68: Ident("a"), - 68..69: Control('.'), - 69..77: Ident("album_id"), - 77..78: Control(','), - 79..80: Ident("a"), - 80..81: Control('.'), - 81..86: Ident("title"), - 86..87: Control('}'), - 88..89: Control('('), - 89..98: Ident("aggregate"), - 99..104: Ident("price"), - 105..106: Control('='), - 107..108: Control('('), - 108..111: Ident("sum"), - 112..118: Ident("tracks"), - 118..119: Control('.'), - 119..129: Ident("unit_price"), - 130..131: Control('|'), - 132..136: Ident("math"), - 136..137: Control('.'), - 137..142: Ident("round"), - 143..144: Literal(Integer(2)), - 144..145: Control(')'), - 145..146: Control(')'), - 146..147: NewLine, - 147..151: Ident("sort"), - 152..160: Ident("album_id"), - 160..161: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..19: Ident("a"), + 19..20: Control('='), + 20..26: Ident("albums"), + 26..27: NewLine, + 27..31: Ident("take"), + 32..34: Literal(Integer(10)), + 34..35: NewLine, + 35..39: Ident("join"), + 40..46: Ident("tracks"), + 47..48: Control('('), + 48..50: Eq, + 50..58: Ident("album_id"), + 58..59: Control(')'), + 59..60: NewLine, + 60..65: Ident("group"), + 66..67: Control('{'), + 67..68: Ident("a"), + 68..69: Control('.'), + 69..77: Ident("album_id"), + 77..78: Control(','), + 79..80: Ident("a"), + 80..81: Control('.'), + 81..86: Ident("title"), + 86..87: Control('}'), + 88..89: Control('('), + 89..98: Ident("aggregate"), + 99..104: Ident("price"), + 105..106: Control('='), + 107..108: Control('('), + 108..111: Ident("sum"), + 112..118: Ident("tracks"), + 118..119: Control('.'), + 119..129: Ident("unit_price"), + 130..131: Control('|'), + 132..136: Ident("math"), + 136..137: Control('.'), + 137..142: Ident("round"), + 143..144: Literal(Integer(2)), + 144..145: Control(')'), + 145..146: Control(')'), + 146..147: NewLine, + 147..151: Ident("sort"), + 152..160: Ident("album_id"), + 160..161: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort.snap index 30c433ce65b8..1bbc56da7b4c 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort.snap @@ -3,52 +3,54 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/group_sort.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..24: Ident("tracks"), - 24..25: NewLine, - 25..31: Ident("derive"), - 32..33: Ident("d"), - 34..35: Control('='), - 36..44: Ident("album_id"), - 45..46: Control('+'), - 47..48: Literal(Integer(1)), - 48..49: NewLine, - 49..54: Ident("group"), - 55..56: Ident("d"), - 57..58: Control('('), - 58..59: NewLine, - 63..72: Ident("aggregate"), - 73..74: Control('{'), - 74..75: NewLine, - 83..85: Ident("n1"), - 86..87: Control('='), - 88..89: Control('('), - 89..97: Ident("track_id"), - 98..99: Control('|'), - 100..103: Ident("sum"), - 103..104: Control(')'), - 104..105: Control(','), - 105..106: NewLine, - 110..111: Control('}'), - 111..112: NewLine, - 112..113: Control(')'), - 113..114: NewLine, - 114..118: Ident("sort"), - 119..120: Ident("d"), - 120..121: NewLine, - 121..125: Ident("take"), - 126..128: Literal(Integer(10)), - 128..129: NewLine, - 129..135: Ident("select"), - 136..137: Control('{'), - 138..140: Ident("d1"), - 141..142: Control('='), - 143..144: Ident("d"), - 144..145: Control(','), - 146..148: Ident("n1"), - 149..150: Control('}'), - 150..151: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..24: Ident("tracks"), + 24..25: NewLine, + 25..31: Ident("derive"), + 32..33: Ident("d"), + 34..35: Control('='), + 36..44: Ident("album_id"), + 45..46: Control('+'), + 47..48: Literal(Integer(1)), + 48..49: NewLine, + 49..54: Ident("group"), + 55..56: Ident("d"), + 57..58: Control('('), + 58..59: NewLine, + 63..72: Ident("aggregate"), + 73..74: Control('{'), + 74..75: NewLine, + 83..85: Ident("n1"), + 86..87: Control('='), + 88..89: Control('('), + 89..97: Ident("track_id"), + 98..99: Control('|'), + 100..103: Ident("sum"), + 103..104: Control(')'), + 104..105: Control(','), + 105..106: NewLine, + 110..111: Control('}'), + 111..112: NewLine, + 112..113: Control(')'), + 113..114: NewLine, + 114..118: Ident("sort"), + 119..120: Ident("d"), + 120..121: NewLine, + 121..125: Ident("take"), + 126..128: Literal(Integer(10)), + 128..129: NewLine, + 129..135: Ident("select"), + 136..137: Control('{'), + 138..140: Ident("d1"), + 141..142: Control('='), + 143..144: Ident("d"), + 144..145: Control(','), + 146..148: Ident("n1"), + 149..150: Control('}'), + 150..151: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap index eab866c765fe..5c594aac0014 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap @@ -3,59 +3,61 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/group_sort_limit_take.prql --- -TokenVec ( - 0..62: Comment(" Compute the 3 longest songs for each genre and sort by genre"), - 62..63: NewLine, - 63..75: Comment(" mssql:test"), - 75..76: NewLine, - 76..80: Ident("from"), - 81..87: Ident("tracks"), - 87..88: NewLine, - 88..94: Ident("select"), - 95..96: Control('{'), - 96..104: Ident("genre_id"), - 104..105: Control(','), - 105..117: Ident("milliseconds"), - 117..118: Control('}'), - 118..119: NewLine, - 119..124: Ident("group"), - 125..126: Control('{'), - 126..134: Ident("genre_id"), - 134..135: Control('}'), - 136..137: Control('('), - 137..138: NewLine, - 140..144: Ident("sort"), - 145..146: Control('{'), - 146..147: Control('-'), - 147..159: Ident("milliseconds"), - 159..160: Control('}'), - 160..161: NewLine, - 163..167: Ident("take"), - 168..169: Literal(Integer(3)), - 169..170: NewLine, - 170..171: Control(')'), - 171..172: NewLine, - 172..176: Ident("join"), - 177..183: Ident("genres"), - 184..185: Control('('), - 185..187: Eq, - 187..195: Ident("genre_id"), - 195..196: Control(')'), - 196..197: NewLine, - 197..203: Ident("select"), - 204..205: Control('{'), - 205..209: Ident("name"), - 209..210: Control(','), - 211..223: Ident("milliseconds"), - 223..224: Control('}'), - 224..225: NewLine, - 225..229: Ident("sort"), - 230..231: Control('{'), - 231..232: Control('+'), - 232..236: Ident("name"), - 236..237: Control(','), - 237..238: Control('-'), - 238..250: Ident("milliseconds"), - 250..251: Control('}'), - 251..252: NewLine, +TokenVec( + [ + 0..62: Comment(" Compute the 3 longest songs for each genre and sort by genre"), + 62..63: NewLine, + 63..75: Comment(" mssql:test"), + 75..76: NewLine, + 76..80: Ident("from"), + 81..87: Ident("tracks"), + 87..88: NewLine, + 88..94: Ident("select"), + 95..96: Control('{'), + 96..104: Ident("genre_id"), + 104..105: Control(','), + 105..117: Ident("milliseconds"), + 117..118: Control('}'), + 118..119: NewLine, + 119..124: Ident("group"), + 125..126: Control('{'), + 126..134: Ident("genre_id"), + 134..135: Control('}'), + 136..137: Control('('), + 137..138: NewLine, + 140..144: Ident("sort"), + 145..146: Control('{'), + 146..147: Control('-'), + 147..159: Ident("milliseconds"), + 159..160: Control('}'), + 160..161: NewLine, + 163..167: Ident("take"), + 168..169: Literal(Integer(3)), + 169..170: NewLine, + 170..171: Control(')'), + 171..172: NewLine, + 172..176: Ident("join"), + 177..183: Ident("genres"), + 184..185: Control('('), + 185..187: Eq, + 187..195: Ident("genre_id"), + 195..196: Control(')'), + 196..197: NewLine, + 197..203: Ident("select"), + 204..205: Control('{'), + 205..209: Ident("name"), + 209..210: Control(','), + 211..223: Ident("milliseconds"), + 223..224: Control('}'), + 224..225: NewLine, + 225..229: Ident("sort"), + 230..231: Control('{'), + 231..232: Control('+'), + 232..236: Ident("name"), + 236..237: Control(','), + 237..238: Control('-'), + 238..250: Ident("milliseconds"), + 250..251: Control('}'), + 251..252: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap index 56934edb610c..2bf974c8ebd3 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap @@ -3,159 +3,161 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/invoice_totals.prql --- -TokenVec ( - 0..56: Comment(" clickhouse:skip (clickhouse doesn't have lag function)"), - 56..57: NewLine, - 57..58: NewLine, - 58..130: DocComment(" Calculate a number of metrics about the sales of tracks in each city."), - 130..131: NewLine, - 131..135: Ident("from"), - 136..137: Ident("i"), - 137..138: Control('='), - 138..146: Ident("invoices"), - 146..147: NewLine, - 147..151: Ident("join"), - 152..154: Ident("ii"), - 154..155: Control('='), - 155..168: Ident("invoice_items"), - 169..170: Control('('), - 170..172: Eq, - 172..182: Ident("invoice_id"), - 182..183: Control(')'), - 183..184: NewLine, - 184..190: Ident("derive"), - 191..192: Control('{'), - 192..193: NewLine, - 197..201: Ident("city"), - 202..203: Control('='), - 204..205: Ident("i"), - 205..206: Control('.'), - 206..218: Ident("billing_city"), - 218..219: Control(','), - 219..220: NewLine, - 224..230: Ident("street"), - 231..232: Control('='), - 233..234: Ident("i"), - 234..235: Control('.'), - 235..250: Ident("billing_address"), - 250..251: Control(','), - 251..252: NewLine, - 252..253: Control('}'), - 253..254: NewLine, - 254..259: Ident("group"), - 260..261: Control('{'), - 261..265: Ident("city"), - 265..266: Control(','), - 267..273: Ident("street"), - 273..274: Control('}'), - 275..276: Control('('), - 276..277: NewLine, - 281..287: Ident("derive"), - 288..293: Ident("total"), - 294..295: Control('='), - 296..298: Ident("ii"), - 298..299: Control('.'), - 299..309: Ident("unit_price"), - 310..311: Control('*'), - 312..314: Ident("ii"), - 314..315: Control('.'), - 315..323: Ident("quantity"), - 323..324: NewLine, - 328..337: Ident("aggregate"), - 338..339: Control('{'), - 339..340: NewLine, - 348..358: Ident("num_orders"), - 359..360: Control('='), - 361..375: Ident("count_distinct"), - 376..377: Ident("i"), - 377..378: Control('.'), - 378..388: Ident("invoice_id"), - 388..389: Control(','), - 389..390: NewLine, - 398..408: Ident("num_tracks"), - 409..410: Control('='), - 411..414: Ident("sum"), - 415..417: Ident("ii"), - 417..418: Control('.'), - 418..426: Ident("quantity"), - 426..427: Control(','), - 427..428: NewLine, - 436..447: Ident("total_price"), - 448..449: Control('='), - 450..453: Ident("sum"), - 454..459: Ident("total"), - 459..460: Control(','), - 460..461: NewLine, - 465..466: Control('}'), - 466..467: NewLine, - 467..468: Control(')'), - 468..469: NewLine, - 469..474: Ident("group"), - 475..476: Control('{'), - 476..480: Ident("city"), - 480..481: Control('}'), - 482..483: Control('('), - 483..484: NewLine, - 488..492: Ident("sort"), - 493..499: Ident("street"), - 499..500: NewLine, - 504..510: Ident("window"), - 511..520: Ident("expanding"), - 520..521: Control(':'), - 521..525: Literal(Boolean(true)), - 526..527: Control('('), - 527..528: NewLine, - 536..542: Ident("derive"), - 543..544: Control('{'), - 544..568: Ident("running_total_num_tracks"), - 569..570: Control('='), - 571..574: Ident("sum"), - 575..585: Ident("num_tracks"), - 585..586: Control('}'), - 586..587: NewLine, - 591..592: Control(')'), - 592..593: NewLine, - 593..594: Control(')'), - 594..595: NewLine, - 595..599: Ident("sort"), - 600..601: Control('{'), - 601..605: Ident("city"), - 605..606: Control(','), - 607..613: Ident("street"), - 613..614: Control('}'), - 614..615: NewLine, - 615..621: Ident("derive"), - 622..623: Control('{'), - 623..643: Ident("num_tracks_last_week"), - 644..645: Control('='), - 646..649: Ident("lag"), - 650..651: Literal(Integer(7)), - 652..662: Ident("num_tracks"), - 662..663: Control('}'), - 663..664: NewLine, - 664..670: Ident("select"), - 671..672: Control('{'), - 672..673: NewLine, - 677..681: Ident("city"), - 681..682: Control(','), - 682..683: NewLine, - 687..693: Ident("street"), - 693..694: Control(','), - 694..695: NewLine, - 699..709: Ident("num_orders"), - 709..710: Control(','), - 710..711: NewLine, - 715..725: Ident("num_tracks"), - 725..726: Control(','), - 726..727: NewLine, - 731..755: Ident("running_total_num_tracks"), - 755..756: Control(','), - 756..757: NewLine, - 761..781: Ident("num_tracks_last_week"), - 781..782: NewLine, - 782..783: Control('}'), - 783..784: NewLine, - 784..788: Ident("take"), - 789..791: Literal(Integer(20)), - 791..792: NewLine, +TokenVec( + [ + 0..56: Comment(" clickhouse:skip (clickhouse doesn't have lag function)"), + 56..57: NewLine, + 57..58: NewLine, + 58..130: DocComment(" Calculate a number of metrics about the sales of tracks in each city."), + 130..131: NewLine, + 131..135: Ident("from"), + 136..137: Ident("i"), + 137..138: Control('='), + 138..146: Ident("invoices"), + 146..147: NewLine, + 147..151: Ident("join"), + 152..154: Ident("ii"), + 154..155: Control('='), + 155..168: Ident("invoice_items"), + 169..170: Control('('), + 170..172: Eq, + 172..182: Ident("invoice_id"), + 182..183: Control(')'), + 183..184: NewLine, + 184..190: Ident("derive"), + 191..192: Control('{'), + 192..193: NewLine, + 197..201: Ident("city"), + 202..203: Control('='), + 204..205: Ident("i"), + 205..206: Control('.'), + 206..218: Ident("billing_city"), + 218..219: Control(','), + 219..220: NewLine, + 224..230: Ident("street"), + 231..232: Control('='), + 233..234: Ident("i"), + 234..235: Control('.'), + 235..250: Ident("billing_address"), + 250..251: Control(','), + 251..252: NewLine, + 252..253: Control('}'), + 253..254: NewLine, + 254..259: Ident("group"), + 260..261: Control('{'), + 261..265: Ident("city"), + 265..266: Control(','), + 267..273: Ident("street"), + 273..274: Control('}'), + 275..276: Control('('), + 276..277: NewLine, + 281..287: Ident("derive"), + 288..293: Ident("total"), + 294..295: Control('='), + 296..298: Ident("ii"), + 298..299: Control('.'), + 299..309: Ident("unit_price"), + 310..311: Control('*'), + 312..314: Ident("ii"), + 314..315: Control('.'), + 315..323: Ident("quantity"), + 323..324: NewLine, + 328..337: Ident("aggregate"), + 338..339: Control('{'), + 339..340: NewLine, + 348..358: Ident("num_orders"), + 359..360: Control('='), + 361..375: Ident("count_distinct"), + 376..377: Ident("i"), + 377..378: Control('.'), + 378..388: Ident("invoice_id"), + 388..389: Control(','), + 389..390: NewLine, + 398..408: Ident("num_tracks"), + 409..410: Control('='), + 411..414: Ident("sum"), + 415..417: Ident("ii"), + 417..418: Control('.'), + 418..426: Ident("quantity"), + 426..427: Control(','), + 427..428: NewLine, + 436..447: Ident("total_price"), + 448..449: Control('='), + 450..453: Ident("sum"), + 454..459: Ident("total"), + 459..460: Control(','), + 460..461: NewLine, + 465..466: Control('}'), + 466..467: NewLine, + 467..468: Control(')'), + 468..469: NewLine, + 469..474: Ident("group"), + 475..476: Control('{'), + 476..480: Ident("city"), + 480..481: Control('}'), + 482..483: Control('('), + 483..484: NewLine, + 488..492: Ident("sort"), + 493..499: Ident("street"), + 499..500: NewLine, + 504..510: Ident("window"), + 511..520: Ident("expanding"), + 520..521: Control(':'), + 521..525: Literal(Boolean(true)), + 526..527: Control('('), + 527..528: NewLine, + 536..542: Ident("derive"), + 543..544: Control('{'), + 544..568: Ident("running_total_num_tracks"), + 569..570: Control('='), + 571..574: Ident("sum"), + 575..585: Ident("num_tracks"), + 585..586: Control('}'), + 586..587: NewLine, + 591..592: Control(')'), + 592..593: NewLine, + 593..594: Control(')'), + 594..595: NewLine, + 595..599: Ident("sort"), + 600..601: Control('{'), + 601..605: Ident("city"), + 605..606: Control(','), + 607..613: Ident("street"), + 613..614: Control('}'), + 614..615: NewLine, + 615..621: Ident("derive"), + 622..623: Control('{'), + 623..643: Ident("num_tracks_last_week"), + 644..645: Control('='), + 646..649: Ident("lag"), + 650..651: Literal(Integer(7)), + 652..662: Ident("num_tracks"), + 662..663: Control('}'), + 663..664: NewLine, + 664..670: Ident("select"), + 671..672: Control('{'), + 672..673: NewLine, + 677..681: Ident("city"), + 681..682: Control(','), + 682..683: NewLine, + 687..693: Ident("street"), + 693..694: Control(','), + 694..695: NewLine, + 699..709: Ident("num_orders"), + 709..710: Control(','), + 710..711: NewLine, + 715..725: Ident("num_tracks"), + 725..726: Control(','), + 726..727: NewLine, + 731..755: Ident("running_total_num_tracks"), + 755..756: Control(','), + 756..757: NewLine, + 761..781: Ident("num_tracks_last_week"), + 781..782: NewLine, + 782..783: Control('}'), + 783..784: NewLine, + 784..788: Ident("take"), + 789..791: Literal(Integer(20)), + 791..792: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__loop_01.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__loop_01.snap index 99ba45a3fea7..4aac0607790b 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__loop_01.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__loop_01.snap @@ -3,50 +3,52 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/loop_01.prql --- -TokenVec ( - 0..47: Comment(" clickhouse:skip (DB::Exception: Syntax error)"), - 47..48: NewLine, - 48..161: Comment(" glaredb:skip (DataFusion does not support recursive CTEs https://github.com/apache/arrow-datafusion/issues/462)"), - 161..162: NewLine, - 162..166: Ident("from"), - 167..168: Control('['), - 168..169: Control('{'), - 169..170: Ident("n"), - 171..172: Control('='), - 173..174: Literal(Integer(1)), - 174..175: Control('}'), - 175..176: Control(']'), - 176..177: NewLine, - 177..183: Ident("select"), - 184..185: Ident("n"), - 186..187: Control('='), - 188..189: Ident("n"), - 190..191: Control('-'), - 192..193: Literal(Integer(2)), - 193..194: NewLine, - 194..198: Ident("loop"), - 199..200: Control('('), - 200..206: Ident("filter"), - 207..208: Ident("n"), - 209..210: Control('<'), - 211..212: Literal(Integer(4)), - 213..214: Control('|'), - 215..221: Ident("select"), - 222..223: Ident("n"), - 224..225: Control('='), - 226..227: Ident("n"), - 228..229: Control('+'), - 230..231: Literal(Integer(1)), - 231..232: Control(')'), - 232..233: NewLine, - 233..239: Ident("select"), - 240..241: Ident("n"), - 242..243: Control('='), - 244..245: Ident("n"), - 246..247: Control('*'), - 248..249: Literal(Integer(2)), - 249..250: NewLine, - 250..254: Ident("sort"), - 255..256: Ident("n"), - 256..257: NewLine, +TokenVec( + [ + 0..47: Comment(" clickhouse:skip (DB::Exception: Syntax error)"), + 47..48: NewLine, + 48..161: Comment(" glaredb:skip (DataFusion does not support recursive CTEs https://github.com/apache/arrow-datafusion/issues/462)"), + 161..162: NewLine, + 162..166: Ident("from"), + 167..168: Control('['), + 168..169: Control('{'), + 169..170: Ident("n"), + 171..172: Control('='), + 173..174: Literal(Integer(1)), + 174..175: Control('}'), + 175..176: Control(']'), + 176..177: NewLine, + 177..183: Ident("select"), + 184..185: Ident("n"), + 186..187: Control('='), + 188..189: Ident("n"), + 190..191: Control('-'), + 192..193: Literal(Integer(2)), + 193..194: NewLine, + 194..198: Ident("loop"), + 199..200: Control('('), + 200..206: Ident("filter"), + 207..208: Ident("n"), + 209..210: Control('<'), + 211..212: Literal(Integer(4)), + 213..214: Control('|'), + 215..221: Ident("select"), + 222..223: Ident("n"), + 224..225: Control('='), + 226..227: Ident("n"), + 228..229: Control('+'), + 230..231: Literal(Integer(1)), + 231..232: Control(')'), + 232..233: NewLine, + 233..239: Ident("select"), + 240..241: Ident("n"), + 242..243: Control('='), + 244..245: Ident("n"), + 246..247: Control('*'), + 248..249: Literal(Integer(2)), + 249..250: NewLine, + 250..254: Ident("sort"), + 255..256: Ident("n"), + 256..257: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__math_module.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__math_module.snap index 524cecd86b61..28d544612ef7 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__math_module.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__math_module.snap @@ -3,205 +3,207 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/math_module.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..81: Comment(" sqlite:skip (see https://github.com/rusqlite/rusqlite/issues/1211)"), - 81..82: NewLine, - 82..86: Ident("from"), - 87..95: Ident("invoices"), - 95..96: NewLine, - 96..100: Ident("take"), - 101..102: Literal(Integer(5)), - 102..103: NewLine, - 103..109: Ident("select"), - 110..111: Control('{'), - 111..112: NewLine, - 116..130: Ident("total_original"), - 131..132: Control('='), - 133..138: Ident("total"), - 139..140: Control('|'), - 141..145: Ident("math"), - 145..146: Control('.'), - 146..151: Ident("round"), - 152..153: Literal(Integer(2)), - 153..154: Control(','), - 154..155: NewLine, - 159..166: Ident("total_x"), - 167..168: Control('='), - 169..173: Ident("math"), - 173..174: Control('.'), - 174..176: Ident("pi"), - 177..178: Control('-'), - 179..184: Ident("total"), - 185..186: Control('|'), - 187..191: Ident("math"), - 191..192: Control('.'), - 192..197: Ident("round"), - 198..199: Literal(Integer(2)), - 200..201: Control('|'), - 202..206: Ident("math"), - 206..207: Control('.'), - 207..210: Ident("abs"), - 210..211: Control(','), - 211..212: NewLine, - 216..227: Ident("total_floor"), - 228..229: Control('='), - 230..234: Ident("math"), - 234..235: Control('.'), - 235..240: Ident("floor"), - 241..246: Ident("total"), - 246..247: Control(','), - 247..248: NewLine, - 252..262: Ident("total_ceil"), - 263..264: Control('='), - 265..269: Ident("math"), - 269..270: Control('.'), - 270..274: Ident("ceil"), - 275..280: Ident("total"), - 280..281: Control(','), - 281..282: NewLine, - 286..297: Ident("total_log10"), - 298..299: Control('='), - 300..304: Ident("math"), - 304..305: Control('.'), - 305..310: Ident("log10"), - 311..316: Ident("total"), - 317..318: Control('|'), - 319..323: Ident("math"), - 323..324: Control('.'), - 324..329: Ident("round"), - 330..331: Literal(Integer(3)), - 331..332: Control(','), - 332..333: NewLine, - 337..347: Ident("total_log2"), - 348..349: Control('='), - 350..354: Ident("math"), - 354..355: Control('.'), - 355..358: Ident("log"), - 359..360: Literal(Integer(2)), - 361..366: Ident("total"), - 367..368: Control('|'), - 369..373: Ident("math"), - 373..374: Control('.'), - 374..379: Ident("round"), - 380..381: Literal(Integer(3)), - 381..382: Control(','), - 382..383: NewLine, - 387..397: Ident("total_sqrt"), - 398..399: Control('='), - 400..404: Ident("math"), - 404..405: Control('.'), - 405..409: Ident("sqrt"), - 410..415: Ident("total"), - 416..417: Control('|'), - 418..422: Ident("math"), - 422..423: Control('.'), - 423..428: Ident("round"), - 429..430: Literal(Integer(3)), - 430..431: Control(','), - 431..432: NewLine, - 436..444: Ident("total_ln"), - 445..446: Control('='), - 447..451: Ident("math"), - 451..452: Control('.'), - 452..454: Ident("ln"), - 455..460: Ident("total"), - 461..462: Control('|'), - 463..467: Ident("math"), - 467..468: Control('.'), - 468..471: Ident("exp"), - 472..473: Control('|'), - 474..478: Ident("math"), - 478..479: Control('.'), - 479..484: Ident("round"), - 485..486: Literal(Integer(2)), - 486..487: Control(','), - 487..488: NewLine, - 492..501: Ident("total_cos"), - 502..503: Control('='), - 504..508: Ident("math"), - 508..509: Control('.'), - 509..512: Ident("cos"), - 513..518: Ident("total"), - 519..520: Control('|'), - 521..525: Ident("math"), - 525..526: Control('.'), - 526..530: Ident("acos"), - 531..532: Control('|'), - 533..537: Ident("math"), - 537..538: Control('.'), - 538..543: Ident("round"), - 544..545: Literal(Integer(2)), - 545..546: Control(','), - 546..547: NewLine, - 551..560: Ident("total_sin"), - 561..562: Control('='), - 563..567: Ident("math"), - 567..568: Control('.'), - 568..571: Ident("sin"), - 572..577: Ident("total"), - 578..579: Control('|'), - 580..584: Ident("math"), - 584..585: Control('.'), - 585..589: Ident("asin"), - 590..591: Control('|'), - 592..596: Ident("math"), - 596..597: Control('.'), - 597..602: Ident("round"), - 603..604: Literal(Integer(2)), - 604..605: Control(','), - 605..606: NewLine, - 610..619: Ident("total_tan"), - 620..621: Control('='), - 622..626: Ident("math"), - 626..627: Control('.'), - 627..630: Ident("tan"), - 631..636: Ident("total"), - 637..638: Control('|'), - 639..643: Ident("math"), - 643..644: Control('.'), - 644..648: Ident("atan"), - 649..650: Control('|'), - 651..655: Ident("math"), - 655..656: Control('.'), - 656..661: Ident("round"), - 662..663: Literal(Integer(2)), - 663..664: Control(','), - 664..665: NewLine, - 669..678: Ident("total_deg"), - 679..680: Control('='), - 681..686: Ident("total"), - 687..688: Control('|'), - 689..693: Ident("math"), - 693..694: Control('.'), - 694..701: Ident("degrees"), - 702..703: Control('|'), - 704..708: Ident("math"), - 708..709: Control('.'), - 709..716: Ident("radians"), - 717..718: Control('|'), - 719..723: Ident("math"), - 723..724: Control('.'), - 724..729: Ident("round"), - 730..731: Literal(Integer(2)), - 731..732: Control(','), - 732..733: NewLine, - 737..749: Ident("total_square"), - 750..751: Control('='), - 752..757: Ident("total"), - 758..759: Control('|'), - 760..764: Ident("math"), - 764..765: Control('.'), - 765..768: Ident("pow"), - 769..770: Literal(Integer(2)), - 770..771: Control('|'), - 772..776: Ident("math"), - 776..777: Control('.'), - 777..782: Ident("round"), - 783..784: Literal(Integer(2)), - 784..785: Control(','), - 785..786: NewLine, - 786..787: Control('}'), - 787..788: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..81: Comment(" sqlite:skip (see https://github.com/rusqlite/rusqlite/issues/1211)"), + 81..82: NewLine, + 82..86: Ident("from"), + 87..95: Ident("invoices"), + 95..96: NewLine, + 96..100: Ident("take"), + 101..102: Literal(Integer(5)), + 102..103: NewLine, + 103..109: Ident("select"), + 110..111: Control('{'), + 111..112: NewLine, + 116..130: Ident("total_original"), + 131..132: Control('='), + 133..138: Ident("total"), + 139..140: Control('|'), + 141..145: Ident("math"), + 145..146: Control('.'), + 146..151: Ident("round"), + 152..153: Literal(Integer(2)), + 153..154: Control(','), + 154..155: NewLine, + 159..166: Ident("total_x"), + 167..168: Control('='), + 169..173: Ident("math"), + 173..174: Control('.'), + 174..176: Ident("pi"), + 177..178: Control('-'), + 179..184: Ident("total"), + 185..186: Control('|'), + 187..191: Ident("math"), + 191..192: Control('.'), + 192..197: Ident("round"), + 198..199: Literal(Integer(2)), + 200..201: Control('|'), + 202..206: Ident("math"), + 206..207: Control('.'), + 207..210: Ident("abs"), + 210..211: Control(','), + 211..212: NewLine, + 216..227: Ident("total_floor"), + 228..229: Control('='), + 230..234: Ident("math"), + 234..235: Control('.'), + 235..240: Ident("floor"), + 241..246: Ident("total"), + 246..247: Control(','), + 247..248: NewLine, + 252..262: Ident("total_ceil"), + 263..264: Control('='), + 265..269: Ident("math"), + 269..270: Control('.'), + 270..274: Ident("ceil"), + 275..280: Ident("total"), + 280..281: Control(','), + 281..282: NewLine, + 286..297: Ident("total_log10"), + 298..299: Control('='), + 300..304: Ident("math"), + 304..305: Control('.'), + 305..310: Ident("log10"), + 311..316: Ident("total"), + 317..318: Control('|'), + 319..323: Ident("math"), + 323..324: Control('.'), + 324..329: Ident("round"), + 330..331: Literal(Integer(3)), + 331..332: Control(','), + 332..333: NewLine, + 337..347: Ident("total_log2"), + 348..349: Control('='), + 350..354: Ident("math"), + 354..355: Control('.'), + 355..358: Ident("log"), + 359..360: Literal(Integer(2)), + 361..366: Ident("total"), + 367..368: Control('|'), + 369..373: Ident("math"), + 373..374: Control('.'), + 374..379: Ident("round"), + 380..381: Literal(Integer(3)), + 381..382: Control(','), + 382..383: NewLine, + 387..397: Ident("total_sqrt"), + 398..399: Control('='), + 400..404: Ident("math"), + 404..405: Control('.'), + 405..409: Ident("sqrt"), + 410..415: Ident("total"), + 416..417: Control('|'), + 418..422: Ident("math"), + 422..423: Control('.'), + 423..428: Ident("round"), + 429..430: Literal(Integer(3)), + 430..431: Control(','), + 431..432: NewLine, + 436..444: Ident("total_ln"), + 445..446: Control('='), + 447..451: Ident("math"), + 451..452: Control('.'), + 452..454: Ident("ln"), + 455..460: Ident("total"), + 461..462: Control('|'), + 463..467: Ident("math"), + 467..468: Control('.'), + 468..471: Ident("exp"), + 472..473: Control('|'), + 474..478: Ident("math"), + 478..479: Control('.'), + 479..484: Ident("round"), + 485..486: Literal(Integer(2)), + 486..487: Control(','), + 487..488: NewLine, + 492..501: Ident("total_cos"), + 502..503: Control('='), + 504..508: Ident("math"), + 508..509: Control('.'), + 509..512: Ident("cos"), + 513..518: Ident("total"), + 519..520: Control('|'), + 521..525: Ident("math"), + 525..526: Control('.'), + 526..530: Ident("acos"), + 531..532: Control('|'), + 533..537: Ident("math"), + 537..538: Control('.'), + 538..543: Ident("round"), + 544..545: Literal(Integer(2)), + 545..546: Control(','), + 546..547: NewLine, + 551..560: Ident("total_sin"), + 561..562: Control('='), + 563..567: Ident("math"), + 567..568: Control('.'), + 568..571: Ident("sin"), + 572..577: Ident("total"), + 578..579: Control('|'), + 580..584: Ident("math"), + 584..585: Control('.'), + 585..589: Ident("asin"), + 590..591: Control('|'), + 592..596: Ident("math"), + 596..597: Control('.'), + 597..602: Ident("round"), + 603..604: Literal(Integer(2)), + 604..605: Control(','), + 605..606: NewLine, + 610..619: Ident("total_tan"), + 620..621: Control('='), + 622..626: Ident("math"), + 626..627: Control('.'), + 627..630: Ident("tan"), + 631..636: Ident("total"), + 637..638: Control('|'), + 639..643: Ident("math"), + 643..644: Control('.'), + 644..648: Ident("atan"), + 649..650: Control('|'), + 651..655: Ident("math"), + 655..656: Control('.'), + 656..661: Ident("round"), + 662..663: Literal(Integer(2)), + 663..664: Control(','), + 664..665: NewLine, + 669..678: Ident("total_deg"), + 679..680: Control('='), + 681..686: Ident("total"), + 687..688: Control('|'), + 689..693: Ident("math"), + 693..694: Control('.'), + 694..701: Ident("degrees"), + 702..703: Control('|'), + 704..708: Ident("math"), + 708..709: Control('.'), + 709..716: Ident("radians"), + 717..718: Control('|'), + 719..723: Ident("math"), + 723..724: Control('.'), + 724..729: Ident("round"), + 730..731: Literal(Integer(2)), + 731..732: Control(','), + 732..733: NewLine, + 737..749: Ident("total_square"), + 750..751: Control('='), + 752..757: Ident("total"), + 758..759: Control('|'), + 760..764: Ident("math"), + 764..765: Control('.'), + 765..768: Ident("pow"), + 769..770: Literal(Integer(2)), + 770..771: Control('|'), + 772..776: Ident("math"), + 776..777: Control('.'), + 777..782: Ident("round"), + 783..784: Literal(Integer(2)), + 784..785: Control(','), + 785..786: NewLine, + 786..787: Control('}'), + 787..788: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__pipelines.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__pipelines.snap index 33b2a6ac8a2c..d1810d113cad 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__pipelines.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__pipelines.snap @@ -3,54 +3,56 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/pipelines.prql --- -TokenVec ( - 0..76: Comment(" sqlite:skip (Only works on Sqlite implementations which have the extension"), - 76..77: NewLine, - 77..88: Comment(" installed"), - 88..89: NewLine, - 89..164: Comment(" https://stackoverflow.com/questions/24037982/how-to-use-regexp-in-sqlite)"), - 164..165: NewLine, - 165..166: NewLine, - 166..170: Ident("from"), - 171..177: Ident("tracks"), - 177..178: NewLine, - 178..179: NewLine, - 179..185: Ident("filter"), - 186..187: Control('('), - 187..191: Ident("name"), - 192..194: RegexSearch, - 195..201: Literal(String("Love")), - 201..202: Control(')'), - 202..203: NewLine, - 203..209: Ident("filter"), - 210..211: Control('('), - 211..212: Control('('), - 212..224: Ident("milliseconds"), - 225..226: Control('/'), - 227..231: Literal(Integer(1000)), - 232..233: Control('/'), - 234..236: Literal(Integer(60)), - 236..237: Control(')'), - 238..239: Control('|'), - 240..242: Ident("in"), - 243..244: Literal(Integer(3)), - 244..246: Range { bind_left: true, bind_right: true }, - 246..247: Literal(Integer(4)), - 247..248: Control(')'), - 248..249: NewLine, - 249..253: Ident("sort"), - 254..262: Ident("track_id"), - 262..263: NewLine, - 263..267: Ident("take"), - 268..269: Literal(Integer(1)), - 269..271: Range { bind_left: true, bind_right: true }, - 271..273: Literal(Integer(15)), - 273..274: NewLine, - 274..280: Ident("select"), - 281..282: Control('{'), - 282..286: Ident("name"), - 286..287: Control(','), - 288..296: Ident("composer"), - 296..297: Control('}'), - 297..298: NewLine, +TokenVec( + [ + 0..76: Comment(" sqlite:skip (Only works on Sqlite implementations which have the extension"), + 76..77: NewLine, + 77..88: Comment(" installed"), + 88..89: NewLine, + 89..164: Comment(" https://stackoverflow.com/questions/24037982/how-to-use-regexp-in-sqlite)"), + 164..165: NewLine, + 165..166: NewLine, + 166..170: Ident("from"), + 171..177: Ident("tracks"), + 177..178: NewLine, + 178..179: NewLine, + 179..185: Ident("filter"), + 186..187: Control('('), + 187..191: Ident("name"), + 192..194: RegexSearch, + 195..201: Literal(String("Love")), + 201..202: Control(')'), + 202..203: NewLine, + 203..209: Ident("filter"), + 210..211: Control('('), + 211..212: Control('('), + 212..224: Ident("milliseconds"), + 225..226: Control('/'), + 227..231: Literal(Integer(1000)), + 232..233: Control('/'), + 234..236: Literal(Integer(60)), + 236..237: Control(')'), + 238..239: Control('|'), + 240..242: Ident("in"), + 243..244: Literal(Integer(3)), + 244..246: Range { bind_left: true, bind_right: true }, + 246..247: Literal(Integer(4)), + 247..248: Control(')'), + 248..249: NewLine, + 249..253: Ident("sort"), + 254..262: Ident("track_id"), + 262..263: NewLine, + 263..267: Ident("take"), + 268..269: Literal(Integer(1)), + 269..271: Range { bind_left: true, bind_right: true }, + 271..273: Literal(Integer(15)), + 273..274: NewLine, + 274..280: Ident("select"), + 281..282: Control('{'), + 282..286: Ident("name"), + 286..287: Control(','), + 288..296: Ident("composer"), + 296..297: Control('}'), + 297..298: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__read_csv.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__read_csv.snap index 06d1d753e4cb..01edf38a97c9 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__read_csv.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__read_csv.snap @@ -3,20 +3,22 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/read_csv.prql --- -TokenVec ( - 0..13: Comment(" sqlite:skip"), - 13..14: NewLine, - 14..29: Comment(" postgres:skip"), - 29..30: NewLine, - 30..42: Comment(" mysql:skip"), - 42..43: NewLine, - 43..47: Ident("from"), - 48..49: Control('('), - 49..57: Ident("read_csv"), - 58..90: Literal(String("data_file_root/media_types.csv")), - 90..91: Control(')'), - 91..92: NewLine, - 92..96: Ident("sort"), - 97..110: Ident("media_type_id"), - 110..111: NewLine, +TokenVec( + [ + 0..13: Comment(" sqlite:skip"), + 13..14: NewLine, + 14..29: Comment(" postgres:skip"), + 29..30: NewLine, + 30..42: Comment(" mysql:skip"), + 42..43: NewLine, + 43..47: Ident("from"), + 48..49: Control('('), + 49..57: Ident("read_csv"), + 58..90: Literal(String("data_file_root/media_types.csv")), + 90..91: Control(')'), + 91..92: NewLine, + 92..96: Ident("sort"), + 97..110: Ident("media_type_id"), + 110..111: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap index 500fb54acc83..2333b4493776 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap @@ -3,53 +3,55 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/set_ops_remove.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..16: Keyword("let"), - 17..25: Ident("distinct"), - 26..27: Control('='), - 28..31: Ident("rel"), - 32..34: ArrowThin, - 35..36: Control('('), - 36..40: Ident("from"), - 41..42: Ident("t"), - 43..44: Control('='), - 45..51: Ident("_param"), - 51..52: Control('.'), - 52..55: Ident("rel"), - 56..57: Control('|'), - 58..63: Ident("group"), - 64..65: Control('{'), - 65..66: Ident("t"), - 66..67: Control('.'), - 67..68: Control('*'), - 68..69: Control('}'), - 70..71: Control('('), - 71..75: Ident("take"), - 76..77: Literal(Integer(1)), - 77..78: Control(')'), - 78..79: Control(')'), - 79..80: NewLine, - 80..81: NewLine, - 81..90: Ident("from_text"), - 91..97: Ident("format"), - 97..98: Control(':'), - 98..102: Ident("json"), - 103..155: Literal(String("{ \"columns\": [\"a\"], \"data\": [[1], [2], [2], [3]] }")), - 155..156: NewLine, - 156..164: Ident("distinct"), - 164..165: NewLine, - 165..171: Ident("remove"), - 172..173: Control('('), - 173..182: Ident("from_text"), - 183..189: Ident("format"), - 189..190: Control(':'), - 190..194: Ident("json"), - 195..237: Literal(String("{ \"columns\": [\"a\"], \"data\": [[1], [2]] }")), - 237..238: Control(')'), - 238..239: NewLine, - 239..243: Ident("sort"), - 244..245: Ident("a"), - 245..246: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..16: Keyword("let"), + 17..25: Ident("distinct"), + 26..27: Control('='), + 28..31: Ident("rel"), + 32..34: ArrowThin, + 35..36: Control('('), + 36..40: Ident("from"), + 41..42: Ident("t"), + 43..44: Control('='), + 45..51: Ident("_param"), + 51..52: Control('.'), + 52..55: Ident("rel"), + 56..57: Control('|'), + 58..63: Ident("group"), + 64..65: Control('{'), + 65..66: Ident("t"), + 66..67: Control('.'), + 67..68: Control('*'), + 68..69: Control('}'), + 70..71: Control('('), + 71..75: Ident("take"), + 76..77: Literal(Integer(1)), + 77..78: Control(')'), + 78..79: Control(')'), + 79..80: NewLine, + 80..81: NewLine, + 81..90: Ident("from_text"), + 91..97: Ident("format"), + 97..98: Control(':'), + 98..102: Ident("json"), + 103..155: Literal(String("{ \"columns\": [\"a\"], \"data\": [[1], [2], [2], [3]] }")), + 155..156: NewLine, + 156..164: Ident("distinct"), + 164..165: NewLine, + 165..171: Ident("remove"), + 172..173: Control('('), + 173..182: Ident("from_text"), + 183..189: Ident("format"), + 189..190: Control(':'), + 190..194: Ident("json"), + 195..237: Literal(String("{ \"columns\": [\"a\"], \"data\": [[1], [2]] }")), + 237..238: Control(')'), + 238..239: NewLine, + 239..243: Ident("sort"), + 244..245: Ident("a"), + 245..246: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__sort.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__sort.snap index 043f3f1f8f20..411cce2f6c3c 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__sort.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__sort.snap @@ -3,60 +3,62 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/sort.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..19: Ident("e"), - 19..20: Control('='), - 20..29: Ident("employees"), - 29..30: NewLine, - 30..36: Ident("filter"), - 37..47: Ident("first_name"), - 48..50: Ne, - 51..61: Literal(String("Mitchell")), - 61..62: NewLine, - 62..66: Ident("sort"), - 67..68: Control('{'), - 68..78: Ident("first_name"), - 78..79: Control(','), - 80..89: Ident("last_name"), - 89..90: Control('}'), - 90..91: NewLine, - 91..92: NewLine, - 92..144: Comment(" joining may use HashMerge, which can undo ORDER BY"), - 144..145: NewLine, - 145..149: Ident("join"), - 150..157: Ident("manager"), - 157..158: Control('='), - 158..167: Ident("employees"), - 168..172: Ident("side"), - 172..173: Control(':'), - 173..177: Ident("left"), - 178..179: Control('('), - 179..180: Ident("e"), - 180..181: Control('.'), - 181..191: Ident("reports_to"), - 192..194: Eq, - 195..202: Ident("manager"), - 202..203: Control('.'), - 203..214: Ident("employee_id"), - 214..215: Control(')'), - 215..216: NewLine, - 216..217: NewLine, - 217..223: Ident("select"), - 224..225: Control('{'), - 225..226: Ident("e"), - 226..227: Control('.'), - 227..237: Ident("first_name"), - 237..238: Control(','), - 239..240: Ident("e"), - 240..241: Control('.'), - 241..250: Ident("last_name"), - 250..251: Control(','), - 252..259: Ident("manager"), - 259..260: Control('.'), - 260..270: Ident("first_name"), - 270..271: Control('}'), - 271..272: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..19: Ident("e"), + 19..20: Control('='), + 20..29: Ident("employees"), + 29..30: NewLine, + 30..36: Ident("filter"), + 37..47: Ident("first_name"), + 48..50: Ne, + 51..61: Literal(String("Mitchell")), + 61..62: NewLine, + 62..66: Ident("sort"), + 67..68: Control('{'), + 68..78: Ident("first_name"), + 78..79: Control(','), + 80..89: Ident("last_name"), + 89..90: Control('}'), + 90..91: NewLine, + 91..92: NewLine, + 92..144: Comment(" joining may use HashMerge, which can undo ORDER BY"), + 144..145: NewLine, + 145..149: Ident("join"), + 150..157: Ident("manager"), + 157..158: Control('='), + 158..167: Ident("employees"), + 168..172: Ident("side"), + 172..173: Control(':'), + 173..177: Ident("left"), + 178..179: Control('('), + 179..180: Ident("e"), + 180..181: Control('.'), + 181..191: Ident("reports_to"), + 192..194: Eq, + 195..202: Ident("manager"), + 202..203: Control('.'), + 203..214: Ident("employee_id"), + 214..215: Control(')'), + 215..216: NewLine, + 216..217: NewLine, + 217..223: Ident("select"), + 224..225: Control('{'), + 225..226: Ident("e"), + 226..227: Control('.'), + 227..237: Ident("first_name"), + 237..238: Control(','), + 239..240: Ident("e"), + 240..241: Control('.'), + 241..250: Ident("last_name"), + 250..251: Control(','), + 252..259: Ident("manager"), + 259..260: Control('.'), + 260..270: Ident("first_name"), + 270..271: Control('}'), + 271..272: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__switch.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__switch.snap index 1e0d88328391..e4601adb1de2 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__switch.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__switch.snap @@ -3,44 +3,46 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/switch.prql --- -TokenVec ( - 0..75: Comment(" glaredb:skip (May be a bag of String type conversion for Postgres Client)"), - 75..76: NewLine, - 76..88: Comment(" mssql:test"), - 88..89: NewLine, - 89..93: Ident("from"), - 94..100: Ident("tracks"), - 100..101: NewLine, - 101..105: Ident("sort"), - 106..118: Ident("milliseconds"), - 118..119: NewLine, - 119..125: Ident("select"), - 126..133: Ident("display"), - 134..135: Control('='), - 136..140: Keyword("case"), - 141..142: Control('['), - 142..143: NewLine, - 147..155: Ident("composer"), - 156..158: Ne, - 159..163: Literal(Null), - 164..166: ArrowFat, - 167..175: Ident("composer"), - 175..176: Control(','), - 176..177: NewLine, - 181..189: Ident("genre_id"), - 190..191: Control('<'), - 192..194: Literal(Integer(17)), - 195..197: ArrowFat, - 198..211: Literal(String("no composer")), - 211..212: Control(','), - 212..213: NewLine, - 217..221: Literal(Boolean(true)), - 222..224: ArrowFat, - 225..244: Interpolation('f', "unknown composer"), - 244..245: NewLine, - 245..246: Control(']'), - 246..247: NewLine, - 247..251: Ident("take"), - 252..254: Literal(Integer(10)), - 254..255: NewLine, +TokenVec( + [ + 0..75: Comment(" glaredb:skip (May be a bag of String type conversion for Postgres Client)"), + 75..76: NewLine, + 76..88: Comment(" mssql:test"), + 88..89: NewLine, + 89..93: Ident("from"), + 94..100: Ident("tracks"), + 100..101: NewLine, + 101..105: Ident("sort"), + 106..118: Ident("milliseconds"), + 118..119: NewLine, + 119..125: Ident("select"), + 126..133: Ident("display"), + 134..135: Control('='), + 136..140: Keyword("case"), + 141..142: Control('['), + 142..143: NewLine, + 147..155: Ident("composer"), + 156..158: Ne, + 159..163: Literal(Null), + 164..166: ArrowFat, + 167..175: Ident("composer"), + 175..176: Control(','), + 176..177: NewLine, + 181..189: Ident("genre_id"), + 190..191: Control('<'), + 192..194: Literal(Integer(17)), + 195..197: ArrowFat, + 198..211: Literal(String("no composer")), + 211..212: Control(','), + 212..213: NewLine, + 217..221: Literal(Boolean(true)), + 222..224: ArrowFat, + 225..244: Interpolation('f', "unknown composer"), + 244..245: NewLine, + 245..246: Control(']'), + 246..247: NewLine, + 247..251: Ident("take"), + 252..254: Literal(Integer(10)), + 254..255: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__take.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__take.snap index a51f5e4113c4..ea222ef67888 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__take.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__take.snap @@ -3,21 +3,23 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/take.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..24: Ident("tracks"), - 24..25: NewLine, - 25..29: Ident("sort"), - 30..31: Control('{'), - 31..32: Control('+'), - 32..40: Ident("track_id"), - 40..41: Control('}'), - 41..42: NewLine, - 42..46: Ident("take"), - 47..48: Literal(Integer(3)), - 48..50: Range { bind_left: true, bind_right: true }, - 50..51: Literal(Integer(5)), - 51..52: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..24: Ident("tracks"), + 24..25: NewLine, + 25..29: Ident("sort"), + 30..31: Control('{'), + 31..32: Control('+'), + 32..40: Ident("track_id"), + 40..41: Control('}'), + 41..42: NewLine, + 42..46: Ident("take"), + 47..48: Literal(Integer(3)), + 48..50: Range { bind_left: true, bind_right: true }, + 50..51: Literal(Integer(5)), + 51..52: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__text_module.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__text_module.snap index 2f537562ff56..810e42b16081 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__text_module.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__text_module.snap @@ -3,132 +3,134 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/text_module.prql --- -TokenVec ( - 0..12: Comment(" mssql:test"), - 12..13: NewLine, - 13..17: Ident("from"), - 18..24: Ident("albums"), - 24..25: NewLine, - 25..31: Ident("select"), - 32..33: Control('{'), - 33..34: NewLine, - 38..43: Ident("title"), - 43..44: Control(','), - 44..45: NewLine, - 49..65: Ident("title_and_spaces"), - 66..67: Control('='), - 68..82: Interpolation('f', " {title} "), - 82..83: Control(','), - 83..84: NewLine, - 88..91: Ident("low"), - 92..93: Control('='), - 94..99: Ident("title"), - 100..101: Control('|'), - 102..106: Ident("text"), - 106..107: Control('.'), - 107..112: Ident("lower"), - 112..113: Control(','), - 113..114: NewLine, - 118..120: Ident("up"), - 121..122: Control('='), - 123..128: Ident("title"), - 129..130: Control('|'), - 131..135: Ident("text"), - 135..136: Control('.'), - 136..141: Ident("upper"), - 141..142: Control(','), - 142..143: NewLine, - 147..155: Ident("ltrimmed"), - 156..157: Control('='), - 158..163: Ident("title"), - 164..165: Control('|'), - 166..170: Ident("text"), - 170..171: Control('.'), - 171..176: Ident("ltrim"), - 176..177: Control(','), - 177..178: NewLine, - 182..190: Ident("rtrimmed"), - 191..192: Control('='), - 193..198: Ident("title"), - 199..200: Control('|'), - 201..205: Ident("text"), - 205..206: Control('.'), - 206..211: Ident("rtrim"), - 211..212: Control(','), - 212..213: NewLine, - 217..224: Ident("trimmed"), - 225..226: Control('='), - 227..232: Ident("title"), - 233..234: Control('|'), - 235..239: Ident("text"), - 239..240: Control('.'), - 240..244: Ident("trim"), - 244..245: Control(','), - 245..246: NewLine, - 250..253: Ident("len"), - 254..255: Control('='), - 256..261: Ident("title"), - 262..263: Control('|'), - 264..268: Ident("text"), - 268..269: Control('.'), - 269..275: Ident("length"), - 275..276: Control(','), - 276..277: NewLine, - 281..285: Ident("subs"), - 286..287: Control('='), - 288..293: Ident("title"), - 294..295: Control('|'), - 296..300: Ident("text"), - 300..301: Control('.'), - 301..308: Ident("extract"), - 309..310: Literal(Integer(2)), - 311..312: Literal(Integer(5)), - 312..313: Control(','), - 313..314: NewLine, - 318..325: Ident("replace"), - 326..327: Control('='), - 328..333: Ident("title"), - 334..335: Control('|'), - 336..340: Ident("text"), - 340..341: Control('.'), - 341..348: Ident("replace"), - 349..353: Literal(String("al")), - 354..360: Literal(String("PIKA")), - 360..361: Control(','), - 361..362: NewLine, - 362..363: Control('}'), - 363..364: NewLine, - 364..368: Ident("sort"), - 369..370: Control('{'), - 370..375: Ident("title"), - 375..376: Control('}'), - 376..377: NewLine, - 377..383: Ident("filter"), - 384..385: Control('('), - 385..390: Ident("title"), - 391..392: Control('|'), - 393..397: Ident("text"), - 397..398: Control('.'), - 398..409: Ident("starts_with"), - 410..417: Literal(String("Black")), - 417..418: Control(')'), - 419..421: Or, - 422..423: Control('('), - 423..428: Ident("title"), - 429..430: Control('|'), - 431..435: Ident("text"), - 435..436: Control('.'), - 436..444: Ident("contains"), - 445..454: Literal(String("Sabbath")), - 454..455: Control(')'), - 456..458: Or, - 459..460: Control('('), - 460..465: Ident("title"), - 466..467: Control('|'), - 468..472: Ident("text"), - 472..473: Control('.'), - 473..482: Ident("ends_with"), - 483..487: Literal(String("os")), - 487..488: Control(')'), - 488..489: NewLine, +TokenVec( + [ + 0..12: Comment(" mssql:test"), + 12..13: NewLine, + 13..17: Ident("from"), + 18..24: Ident("albums"), + 24..25: NewLine, + 25..31: Ident("select"), + 32..33: Control('{'), + 33..34: NewLine, + 38..43: Ident("title"), + 43..44: Control(','), + 44..45: NewLine, + 49..65: Ident("title_and_spaces"), + 66..67: Control('='), + 68..82: Interpolation('f', " {title} "), + 82..83: Control(','), + 83..84: NewLine, + 88..91: Ident("low"), + 92..93: Control('='), + 94..99: Ident("title"), + 100..101: Control('|'), + 102..106: Ident("text"), + 106..107: Control('.'), + 107..112: Ident("lower"), + 112..113: Control(','), + 113..114: NewLine, + 118..120: Ident("up"), + 121..122: Control('='), + 123..128: Ident("title"), + 129..130: Control('|'), + 131..135: Ident("text"), + 135..136: Control('.'), + 136..141: Ident("upper"), + 141..142: Control(','), + 142..143: NewLine, + 147..155: Ident("ltrimmed"), + 156..157: Control('='), + 158..163: Ident("title"), + 164..165: Control('|'), + 166..170: Ident("text"), + 170..171: Control('.'), + 171..176: Ident("ltrim"), + 176..177: Control(','), + 177..178: NewLine, + 182..190: Ident("rtrimmed"), + 191..192: Control('='), + 193..198: Ident("title"), + 199..200: Control('|'), + 201..205: Ident("text"), + 205..206: Control('.'), + 206..211: Ident("rtrim"), + 211..212: Control(','), + 212..213: NewLine, + 217..224: Ident("trimmed"), + 225..226: Control('='), + 227..232: Ident("title"), + 233..234: Control('|'), + 235..239: Ident("text"), + 239..240: Control('.'), + 240..244: Ident("trim"), + 244..245: Control(','), + 245..246: NewLine, + 250..253: Ident("len"), + 254..255: Control('='), + 256..261: Ident("title"), + 262..263: Control('|'), + 264..268: Ident("text"), + 268..269: Control('.'), + 269..275: Ident("length"), + 275..276: Control(','), + 276..277: NewLine, + 281..285: Ident("subs"), + 286..287: Control('='), + 288..293: Ident("title"), + 294..295: Control('|'), + 296..300: Ident("text"), + 300..301: Control('.'), + 301..308: Ident("extract"), + 309..310: Literal(Integer(2)), + 311..312: Literal(Integer(5)), + 312..313: Control(','), + 313..314: NewLine, + 318..325: Ident("replace"), + 326..327: Control('='), + 328..333: Ident("title"), + 334..335: Control('|'), + 336..340: Ident("text"), + 340..341: Control('.'), + 341..348: Ident("replace"), + 349..353: Literal(String("al")), + 354..360: Literal(String("PIKA")), + 360..361: Control(','), + 361..362: NewLine, + 362..363: Control('}'), + 363..364: NewLine, + 364..368: Ident("sort"), + 369..370: Control('{'), + 370..375: Ident("title"), + 375..376: Control('}'), + 376..377: NewLine, + 377..383: Ident("filter"), + 384..385: Control('('), + 385..390: Ident("title"), + 391..392: Control('|'), + 393..397: Ident("text"), + 397..398: Control('.'), + 398..409: Ident("starts_with"), + 410..417: Literal(String("Black")), + 417..418: Control(')'), + 419..421: Or, + 422..423: Control('('), + 423..428: Ident("title"), + 429..430: Control('|'), + 431..435: Ident("text"), + 435..436: Control('.'), + 436..444: Ident("contains"), + 445..454: Literal(String("Sabbath")), + 454..455: Control(')'), + 456..458: Or, + 459..460: Control('('), + 460..465: Ident("title"), + 466..467: Control('|'), + 468..472: Ident("text"), + 472..473: Control('.'), + 473..482: Ident("ends_with"), + 483..487: Literal(String("os")), + 487..488: Control(')'), + 488..489: NewLine, + ], ) diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__window.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__window.snap index 0b66793a09df..59980d10c4f7 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__window.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__lex__window.snap @@ -3,76 +3,78 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: tokens input_file: prqlc/prqlc/tests/integration/queries/window.prql --- -TokenVec ( - 0..95: Comment(" mssql:skip Conversion(\"cannot interpret I64(Some(1)) as an i32 value\")', connection.rs:200:34"), - 95..96: NewLine, - 96..251: Comment(" duckdb:skip problems with DISTINCT ON (duckdb internal error: [with INPUT_TYPE = int; RESULT_TYPE = unsigned char]: Assertion `min_val <= input' failed.)"), - 251..252: NewLine, - 252..295: Comment(" clickhouse:skip problems with DISTINCT ON"), - 295..296: NewLine, - 296..337: Comment(" postgres:skip problems with DISTINCT ON"), - 337..338: NewLine, - 338..342: Ident("from"), - 343..349: Ident("tracks"), - 349..350: NewLine, - 350..355: Ident("group"), - 356..364: Ident("genre_id"), - 365..366: Control('('), - 366..367: NewLine, - 369..373: Ident("sort"), - 374..386: Ident("milliseconds"), - 386..387: NewLine, - 389..395: Ident("derive"), - 396..397: Control('{'), - 397..398: NewLine, - 402..405: Ident("num"), - 406..407: Control('='), - 408..418: Ident("row_number"), - 419..423: Ident("this"), - 423..424: Control(','), - 424..425: NewLine, - 429..434: Ident("total"), - 435..436: Control('='), - 437..442: Ident("count"), - 443..447: Ident("this"), - 447..448: Control(','), - 448..449: NewLine, - 453..461: Ident("last_val"), - 462..463: Control('='), - 464..468: Ident("last"), - 469..477: Ident("track_id"), - 477..478: Control(','), - 478..479: NewLine, - 481..482: Control('}'), - 482..483: NewLine, - 485..489: Ident("take"), - 490..492: Literal(Integer(10)), - 492..493: NewLine, - 493..494: Control(')'), - 494..495: NewLine, - 495..499: Ident("sort"), - 500..501: Control('{'), - 501..509: Ident("genre_id"), - 509..510: Control(','), - 511..523: Ident("milliseconds"), - 523..524: Control('}'), - 524..525: NewLine, - 525..531: Ident("select"), - 532..533: Control('{'), - 533..541: Ident("track_id"), - 541..542: Control(','), - 543..551: Ident("genre_id"), - 551..552: Control(','), - 553..556: Ident("num"), - 556..557: Control(','), - 558..563: Ident("total"), - 563..564: Control(','), - 565..573: Ident("last_val"), - 573..574: Control('}'), - 574..575: NewLine, - 575..581: Ident("filter"), - 582..590: Ident("genre_id"), - 591..593: Gte, - 594..596: Literal(Integer(22)), - 596..597: NewLine, +TokenVec( + [ + 0..95: Comment(" mssql:skip Conversion(\"cannot interpret I64(Some(1)) as an i32 value\")', connection.rs:200:34"), + 95..96: NewLine, + 96..251: Comment(" duckdb:skip problems with DISTINCT ON (duckdb internal error: [with INPUT_TYPE = int; RESULT_TYPE = unsigned char]: Assertion `min_val <= input' failed.)"), + 251..252: NewLine, + 252..295: Comment(" clickhouse:skip problems with DISTINCT ON"), + 295..296: NewLine, + 296..337: Comment(" postgres:skip problems with DISTINCT ON"), + 337..338: NewLine, + 338..342: Ident("from"), + 343..349: Ident("tracks"), + 349..350: NewLine, + 350..355: Ident("group"), + 356..364: Ident("genre_id"), + 365..366: Control('('), + 366..367: NewLine, + 369..373: Ident("sort"), + 374..386: Ident("milliseconds"), + 386..387: NewLine, + 389..395: Ident("derive"), + 396..397: Control('{'), + 397..398: NewLine, + 402..405: Ident("num"), + 406..407: Control('='), + 408..418: Ident("row_number"), + 419..423: Ident("this"), + 423..424: Control(','), + 424..425: NewLine, + 429..434: Ident("total"), + 435..436: Control('='), + 437..442: Ident("count"), + 443..447: Ident("this"), + 447..448: Control(','), + 448..449: NewLine, + 453..461: Ident("last_val"), + 462..463: Control('='), + 464..468: Ident("last"), + 469..477: Ident("track_id"), + 477..478: Control(','), + 478..479: NewLine, + 481..482: Control('}'), + 482..483: NewLine, + 485..489: Ident("take"), + 490..492: Literal(Integer(10)), + 492..493: NewLine, + 493..494: Control(')'), + 494..495: NewLine, + 495..499: Ident("sort"), + 500..501: Control('{'), + 501..509: Ident("genre_id"), + 509..510: Control(','), + 511..523: Ident("milliseconds"), + 523..524: Control('}'), + 524..525: NewLine, + 525..531: Ident("select"), + 532..533: Control('{'), + 533..541: Ident("track_id"), + 541..542: Control(','), + 543..551: Ident("genre_id"), + 551..552: Control(','), + 553..556: Ident("num"), + 556..557: Control(','), + 558..563: Ident("total"), + 563..564: Control(','), + 565..573: Ident("last_val"), + 573..574: Control('}'), + 574..575: NewLine, + 575..581: Ident("filter"), + 582..590: Ident("genre_id"), + 591..593: Gte, + 594..596: Literal(Integer(22)), + 596..597: NewLine, + ], )