Mercurial > urweb
comparison src/monoize.sml @ 1775:6bc2a8cb3a67
Track whether SQL expressions may use window functions, in preparation for actual window function support
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 02 Jun 2012 15:35:58 -0400 |
parents | a1380fc15cb5 |
children | 8f28c3295148 |
comparison
equal
deleted
inserted
replaced
1774:27fdd78bd2f5 | 1775:6bc2a8cb3a67 |
---|---|
247 (L'.TFfi ("Basis", "string"), loc) | 247 (L'.TFfi ("Basis", "string"), loc) |
248 | L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_query1"), _), _), _), _), _), _), _), _), _), _) => | 248 | L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_query1"), _), _), _), _), _), _), _), _), _), _) => |
249 (L'.TFfi ("Basis", "string"), loc) | 249 (L'.TFfi ("Basis", "string"), loc) |
250 | L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_from_items"), _), _), _), _) => | 250 | L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_from_items"), _), _), _), _) => |
251 (L'.TFfi ("Basis", "string"), loc) | 251 (L'.TFfi ("Basis", "string"), loc) |
252 | L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_exp"), _), _), _), _), _), _), _), _) => | 252 | L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_exp"), _), _), _), _), _), _), _), _), _), _) => |
253 (L'.TFfi ("Basis", "string"), loc) | 253 (L'.TFfi ("Basis", "string"), loc) |
254 | L.CApp ((L.CApp ((L.CFfi ("Basis", "primary_key"), _), _), _), _) => | 254 | L.CApp ((L.CApp ((L.CFfi ("Basis", "primary_key"), _), _), _), _) => |
255 (L'.TFfi ("Basis", "string"), loc) | 255 (L'.TFfi ("Basis", "string"), loc) |
256 | L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_constraints"), _), _), _), _) => | 256 | L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_constraints"), _), _), _), _) => |
257 (L'.TFfi ("Basis", "sql_constraints"), loc) | 257 (L'.TFfi ("Basis", "sql_constraints"), loc) |
2105 | 2105 |
2106 | L.ECApp ( | 2106 | L.ECApp ( |
2107 (L.ECApp ( | 2107 (L.ECApp ( |
2108 (L.ECApp ( | 2108 (L.ECApp ( |
2109 (L.ECApp ( | 2109 (L.ECApp ( |
2110 (L.EFfi ("Basis", "sql_inject"), _), | 2110 (L.ECApp ( |
2111 (L.EFfi ("Basis", "sql_inject"), _), | |
2112 _), _), | |
2111 _), _), | 2113 _), _), |
2112 _), _), | 2114 _), _), |
2113 _), _), | 2115 _), _), |
2114 t) => | 2116 t) => |
2115 let | 2117 let |
2504 | L.ECApp ( | 2506 | L.ECApp ( |
2505 (L.ECApp ( | 2507 (L.ECApp ( |
2506 (L.ECApp ( | 2508 (L.ECApp ( |
2507 (L.ECApp ( | 2509 (L.ECApp ( |
2508 (L.ECApp ( | 2510 (L.ECApp ( |
2511 (L.ECApp ( | |
2509 (L.EFfi ("Basis", "sql_unary"), _), | 2512 (L.EFfi ("Basis", "sql_unary"), _), |
2510 _), _), | 2513 _), _), |
2514 _), _), | |
2511 _), _), | 2515 _), _), |
2512 _), _), | 2516 _), _), |
2513 _), _), | 2517 _), _), |
2514 _) => | 2518 _) => |
2515 let | 2519 let |
2534 (L.ECApp ( | 2538 (L.ECApp ( |
2535 (L.ECApp ( | 2539 (L.ECApp ( |
2536 (L.ECApp ( | 2540 (L.ECApp ( |
2537 (L.ECApp ( | 2541 (L.ECApp ( |
2538 (L.ECApp ( | 2542 (L.ECApp ( |
2539 (L.EFfi ("Basis", "sql_binary"), _), | 2543 (L.ECApp ( |
2544 (L.EFfi ("Basis", "sql_binary"), _), | |
2545 _), _), | |
2540 _), _), | 2546 _), _), |
2541 _), _), | 2547 _), _), |
2542 _), _), | 2548 _), _), |
2543 _), _), | 2549 _), _), |
2544 _), _), | 2550 _), _), |
2567 (L.ECApp ( | 2573 (L.ECApp ( |
2568 (L.ECApp ( | 2574 (L.ECApp ( |
2569 (L.ECApp ( | 2575 (L.ECApp ( |
2570 (L.ECApp ( | 2576 (L.ECApp ( |
2571 (L.ECApp ( | 2577 (L.ECApp ( |
2572 (L.EFfi ("Basis", "sql_field"), _), | 2578 (L.ECApp ( |
2579 (L.EFfi ("Basis", "sql_field"), _), | |
2580 _), _), | |
2573 _), _), | 2581 _), _), |
2574 _), _), | 2582 _), _), |
2575 _), _), | 2583 _), _), |
2576 _), _), | 2584 _), _), |
2577 _), _), | 2585 _), _), |
2581 | L.ECApp ( | 2589 | L.ECApp ( |
2582 (L.ECApp ( | 2590 (L.ECApp ( |
2583 (L.ECApp ( | 2591 (L.ECApp ( |
2584 (L.ECApp ( | 2592 (L.ECApp ( |
2585 (L.ECApp ( | 2593 (L.ECApp ( |
2586 (L.EFfi ("Basis", "sql_exp"), _), | 2594 (L.ECApp ( |
2595 (L.EFfi ("Basis", "sql_exp"), _), | |
2596 _), _), | |
2587 _), _), | 2597 _), _), |
2588 _), _), | 2598 _), _), |
2589 _), _), | 2599 _), _), |
2590 _), _), | 2600 _), _), |
2591 (L.CName nm, _)) => ((L'.EPrim (Prim.String ("uw_" ^ lowercaseFirst nm)), loc), fm) | 2601 (L.CName nm, _)) => ((L'.EPrim (Prim.String ("uw_" ^ lowercaseFirst nm)), loc), fm) |
2685 ((L'.EPrim (Prim.String "EXCEPT"), loc), fm)) | 2695 ((L'.EPrim (Prim.String "EXCEPT"), loc), fm)) |
2686 | 2696 |
2687 | L.ECApp ( | 2697 | L.ECApp ( |
2688 (L.ECApp ( | 2698 (L.ECApp ( |
2689 (L.ECApp ( | 2699 (L.ECApp ( |
2690 (L.EFfi ("Basis", "sql_count"), _), | 2700 (L.ECApp ( |
2701 (L.EFfi ("Basis", "sql_count"), _), | |
2702 _), _), | |
2691 _), _), | 2703 _), _), |
2692 _), _), | 2704 _), _), |
2693 _) => ((L'.EPrim (Prim.String "COUNT(*)"), loc), | 2705 _) => ((L'.EPrim (Prim.String "COUNT(*)"), loc), |
2694 fm) | 2706 fm) |
2695 | 2707 |
2696 | L.ECApp ( | 2708 | L.ECApp ( |
2697 (L.ECApp ( | 2709 (L.ECApp ( |
2698 (L.ECApp ( | 2710 (L.ECApp ( |
2699 (L.ECApp ( | 2711 (L.ECApp ( |
2700 (L.ECApp ( | 2712 (L.ECApp ( |
2701 (L.EFfi ("Basis", "sql_aggregate"), _), | 2713 (L.ECApp ( |
2714 (L.EFfi ("Basis", "sql_aggregate"), _), | |
2715 _), _), | |
2702 _), _), | 2716 _), _), |
2703 _), _), | 2717 _), _), |
2704 _), _), | 2718 _), _), |
2705 _), _), | 2719 _), _), |
2706 t) => | 2720 t) => |
2768 | L.EFfi ("Basis", "sql_desc") => ((L'.EPrim (Prim.String " DESC"), loc), fm) | 2782 | L.EFfi ("Basis", "sql_desc") => ((L'.EPrim (Prim.String " DESC"), loc), fm) |
2769 | L.ECApp ( | 2783 | L.ECApp ( |
2770 (L.ECApp ( | 2784 (L.ECApp ( |
2771 (L.ECApp ( | 2785 (L.ECApp ( |
2772 (L.ECApp ( | 2786 (L.ECApp ( |
2773 (L.EFfi ("Basis", "sql_nfunc"), _), | 2787 (L.ECApp ( |
2788 (L.EFfi ("Basis", "sql_nfunc"), _), | |
2789 _), _), | |
2774 _), _), | 2790 _), _), |
2775 _), _), | 2791 _), _), |
2776 _), _), | 2792 _), _), |
2777 _) => | 2793 _) => |
2778 let | 2794 let |
2779 val s = (L'.TFfi ("Basis", "string"), loc) | 2795 val s = (L'.TFfi ("Basis", "string"), loc) |
2780 fun sc s = (L'.EPrim (Prim.String s), loc) | 2796 fun sc s = (L'.EPrim (Prim.String s), loc) |
2781 in | 2797 in |
2782 ((L'.EAbs ("s", s, s, (L'.ERel 0, loc)), loc), | 2798 ((L'.EAbs ("s", s, s, (L'.ERel 0, loc)), loc), |
2787 | L.ECApp ( | 2803 | L.ECApp ( |
2788 (L.ECApp ( | 2804 (L.ECApp ( |
2789 (L.ECApp ( | 2805 (L.ECApp ( |
2790 (L.ECApp ( | 2806 (L.ECApp ( |
2791 (L.ECApp ( | 2807 (L.ECApp ( |
2792 (L.EFfi ("Basis", "sql_ufunc"), _), | 2808 (L.ECApp ( |
2809 (L.EFfi ("Basis", "sql_ufunc"), _), | |
2810 _), _), | |
2793 _), _), | 2811 _), _), |
2794 _), _), | 2812 _), _), |
2795 _), _), | 2813 _), _), |
2796 _), _), | 2814 _), _), |
2797 _) => | 2815 _) => |
2821 | 2839 |
2822 | (L.ECApp ( | 2840 | (L.ECApp ( |
2823 (L.ECApp ( | 2841 (L.ECApp ( |
2824 (L.ECApp ( | 2842 (L.ECApp ( |
2825 (L.ECApp ( | 2843 (L.ECApp ( |
2826 (L.EFfi ("Basis", "sql_is_null"), _), _), | 2844 (L.ECApp ( |
2845 (L.EFfi ("Basis", "sql_is_null"), _), _), | |
2846 _), _), | |
2827 _), _), | 2847 _), _), |
2828 _), _), | 2848 _), _), |
2829 _), _)) => | 2849 _), _)) => |
2830 let | 2850 let |
2831 val s = (L'.TFfi ("Basis", "string"), loc) | 2851 val s = (L'.TFfi ("Basis", "string"), loc) |
2862 | 2882 |
2863 | (L.ECApp ( | 2883 | (L.ECApp ( |
2864 (L.ECApp ( | 2884 (L.ECApp ( |
2865 (L.ECApp ( | 2885 (L.ECApp ( |
2866 (L.ECApp ( | 2886 (L.ECApp ( |
2867 (L.EFfi ("Basis", "sql_if_then_else"), _), _), | 2887 (L.ECApp ( |
2888 (L.ECApp ( | |
2889 (L.EFfi ("Basis", "sql_if_then_else"), _), _), | |
2890 _), _), | |
2891 _), _), | |
2868 _), _), | 2892 _), _), |
2869 _), _), | 2893 _), _), |
2870 _), _)) => | 2894 _), _)) => |
2871 let | 2895 let |
2872 val s = (L'.TFfi ("Basis", "string"), loc) | 2896 val s = (L'.TFfi ("Basis", "string"), loc) |
2887 | 2911 |
2888 | L.ECApp ( | 2912 | L.ECApp ( |
2889 (L.ECApp ( | 2913 (L.ECApp ( |
2890 (L.ECApp ( | 2914 (L.ECApp ( |
2891 (L.ECApp ( | 2915 (L.ECApp ( |
2892 (L.EFfi ("Basis", "sql_nullable"), _), | 2916 (L.ECApp ( |
2917 (L.EFfi ("Basis", "sql_nullable"), _), | |
2918 _), _), | |
2893 _), _), | 2919 _), _), |
2894 _), _), | 2920 _), _), |
2895 _), _), | 2921 _), _), |
2896 _) => | 2922 _) => |
2897 let | 2923 let |
2908 (L.ECApp ( | 2934 (L.ECApp ( |
2909 (L.ECApp ( | 2935 (L.ECApp ( |
2910 (L.ECApp ( | 2936 (L.ECApp ( |
2911 (L.ECApp ( | 2937 (L.ECApp ( |
2912 (L.ECApp ( | 2938 (L.ECApp ( |
2913 (L.EFfi ("Basis", "sql_subquery"), _), | 2939 (L.ECApp ( |
2940 (L.EFfi ("Basis", "sql_subquery"), _), | |
2941 _), _), | |
2914 _), _), | 2942 _), _), |
2915 _), _), | 2943 _), _), |
2916 _), _), | 2944 _), _), |
2917 _), _), | 2945 _), _), |
2918 _), _), | 2946 _), _), |