MCPcopy Create free account
hub / github.com/PRQL/prql / parse

Function parse

prqlc/prqlc/src/cli/mod.rs:761–804  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

759
760 #[test]
761 fn parse() {
762 let output = Command::execute(
763 &Command::Parse {
764 io_args: IoArgs::default(),
765 format: Format::Yaml,
766 },
767 &mut "from x | select y".into(),
768 "",
769 )
770 .unwrap();
771
772 assert_snapshot!(String::from_utf8(output).unwrap().trim(), @"
773 name: Project
774 stmts:
775 - VarDef:
776 kind: Main
777 name: main
778 value:
779 Pipeline:
780 exprs:
781 - FuncCall:
782 name:
783 Ident:
784 - from
785 span: 1:0-4
786 args:
787 - Ident:
788 - x
789 span: 1:5-6
790 span: 1:0-6
791 - FuncCall:
792 name:
793 Ident:
794 - select
795 span: 1:9-15
796 args:
797 - Ident:
798 - y
799 span: 1:16-17
800 span: 1:9-17
801 span: 1:0-17
802 span: 1:0-17
803 ");
804 }
805 #[test]
806 fn lex() {
807 let output = Command::execute(

Callers 4

mainFunction · 0.70
stdFunction · 0.50
parse_resolve_and_lowerFunction · 0.50
parse_and_resolveFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected