sanify alias/SELECT list rendering
[dbsrgits/Data-Query.git] / t / expr.include
index 74adb47..beaff7c 100644 (file)
@@ -30,10 +30,15 @@ sub SELECT (&;@) {
   my @final;
   while (@select) {
     my $e = shift @select;
-    push @final, my $res = { expr => $e->{expr} };
-    if (ref($select[0]) eq 'LIES::AS') {
-      $res->{name} = identifier(${shift @select});
-    }
+    push @final,
+      (ref($select[0]) eq 'LIES::AS'
+        ? +{
+             type => DQ_ALIAS,
+             alias => $e->{expr},
+             as => ${shift(@select)}
+          }
+        : $e->{expr}
+     );
   }
       
   return +{