comparison src/cjr_print.sml @ 1112:7a31e0cf25e9

Proper C-side deserialization; Shake.sliceDb
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Jan 2010 12:47:27 -0500
parents e1d738870086
children 01b6c7144a44
comparison
equal deleted inserted replaced
1111:e1d738870086 1112:7a31e0cf25e9
1861 1861
1862 string "uw_unit_v;", 1862 string "uw_unit_v;",
1863 newline, 1863 newline,
1864 string "})"] 1864 string "})"]
1865 1865
1866 | EUnurlify (e, t) => 1866 | EUnurlify (e, t, true) =>
1867 let 1867 let
1868 fun getIt () = 1868 fun getIt () =
1869 if isUnboxable t then 1869 if isUnboxable t then
1870 unurlify false env t 1870 unurlify false env t
1871 else 1871 else
1892 newline, 1892 newline,
1893 newline, 1893 newline,
1894 string "(request ? ", 1894 string "(request ? ",
1895 getIt (), 1895 getIt (),
1896 string " : NULL);", 1896 string " : NULL);",
1897 newline,
1898 string "})"]
1899 end
1900
1901 | EUnurlify (e, t, false) =>
1902 let
1903 fun getIt () =
1904 if isUnboxable t then
1905 unurlify false env t
1906 else
1907 box [string "({",
1908 newline,
1909 p_typ env t,
1910 string " *tmp = uw_malloc(ctx, sizeof(",
1911 p_typ env t,
1912 string "));",
1913 newline,
1914 string "*tmp = ",
1915 unurlify false env t,
1916 string ";",
1917 newline,
1918 string "tmp;",
1919 newline,
1920 string "})"]
1921 in
1922 box [string "({",
1923 newline,
1924 string "uw_Basis_string request = uw_maybe_strdup(ctx, ",
1925 p_exp env e,
1926 string ");",
1927 newline,
1928 newline,
1929 unurlify false env t,
1930 string ";",
1897 newline, 1931 newline,
1898 string "})"] 1932 string "})"]
1899 end 1933 end
1900 1934
1901 and p_exp env = p_exp' false env 1935 and p_exp env = p_exp' false env