diff options
Diffstat (limited to 'ddl/out/LambdaCube.TypeInfo.purs')
-rw-r--r-- | ddl/out/LambdaCube.TypeInfo.purs | 68 |
1 files changed, 64 insertions, 4 deletions
diff --git a/ddl/out/LambdaCube.TypeInfo.purs b/ddl/out/LambdaCube.TypeInfo.purs index eee3d0c..db22d59 100644 --- a/ddl/out/LambdaCube.TypeInfo.purs +++ b/ddl/out/LambdaCube.TypeInfo.purs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-09-15T19:44:48.120020034Z | 2 | -- 2016-11-10T15:07:11.972496000000Z |
3 | 3 | ||
4 | module LambdaCube.TypeInfo where | 4 | module LambdaCube.TypeInfo where |
5 | import Prelude | 5 | import Prelude |
@@ -36,9 +36,23 @@ data TypeInfo | |||
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | data WarningInfo | ||
40 | = WarningInfo | ||
41 | { wRange :: Range | ||
42 | , wText :: String | ||
43 | } | ||
44 | |||
45 | |||
46 | data ErrorInfo | ||
47 | = ErrorInfo | ||
48 | { eRange :: Range | ||
49 | , eText :: String | ||
50 | } | ||
51 | |||
52 | |||
39 | data CompileResult | 53 | data CompileResult |
40 | = CompileError (Array Range) String (Array TypeInfo) | 54 | = CompileError (Array TypeInfo) (Array WarningInfo) (Array ErrorInfo) |
41 | | Compiled String String Pipeline (Array TypeInfo) | 55 | | Compiled String String Pipeline (Array TypeInfo) (Array WarningInfo) |
42 | 56 | ||
43 | 57 | ||
44 | 58 | ||
@@ -92,10 +106,52 @@ instance decodeJsonTypeInfo :: DecodeJson TypeInfo where | |||
92 | } | 106 | } |
93 | _ -> unsafeCrashWith "decodeJson @ TypeInfo" | 107 | _ -> unsafeCrashWith "decodeJson @ TypeInfo" |
94 | 108 | ||
109 | instance encodeJsonWarningInfo :: EncodeJson WarningInfo where | ||
110 | encodeJson v = case v of | ||
111 | WarningInfo r -> | ||
112 | "tag" := "WarningInfo" ~> | ||
113 | "wRange" := r.wRange ~> | ||
114 | "wText" := r.wText ~> | ||
115 | jsonEmptyObject | ||
116 | |||
117 | instance decodeJsonWarningInfo :: DecodeJson WarningInfo where | ||
118 | decodeJson json = do | ||
119 | obj <- decodeJson json | ||
120 | tag <- obj .? "tag" | ||
121 | case tag of | ||
122 | "WarningInfo" -> do | ||
123 | wRange <- obj .? "wRange" | ||
124 | wText <- obj .? "wText" | ||
125 | pure $ WarningInfo | ||
126 | { wRange:wRange | ||
127 | , wText:wText | ||
128 | } | ||
129 | |||
130 | instance encodeJsonErrorInfo :: EncodeJson ErrorInfo where | ||
131 | encodeJson v = case v of | ||
132 | ErrorInfo r -> | ||
133 | "tag" := "ErrorInfo" ~> | ||
134 | "eRange" := r.eRange ~> | ||
135 | "eText" := r.eText ~> | ||
136 | jsonEmptyObject | ||
137 | |||
138 | instance decodeJsonErrorInfo :: DecodeJson ErrorInfo where | ||
139 | decodeJson json = do | ||
140 | obj <- decodeJson json | ||
141 | tag <- obj .? "tag" | ||
142 | case tag of | ||
143 | "ErrorInfo" -> do | ||
144 | eRange <- obj .? "eRange" | ||
145 | eText <- obj .? "eText" | ||
146 | pure $ ErrorInfo | ||
147 | { eRange:eRange | ||
148 | , eText:eText | ||
149 | } | ||
150 | |||
95 | instance encodeJsonCompileResult :: EncodeJson CompileResult where | 151 | instance encodeJsonCompileResult :: EncodeJson CompileResult where |
96 | encodeJson v = case v of | 152 | encodeJson v = case v of |
97 | CompileError arg0 arg1 arg2 -> "tag" := "CompileError" ~> "arg0" := arg0 ~> "arg1" := arg1 ~> "arg2" := arg2 ~> jsonEmptyObject | 153 | CompileError arg0 arg1 arg2 -> "tag" := "CompileError" ~> "arg0" := arg0 ~> "arg1" := arg1 ~> "arg2" := arg2 ~> jsonEmptyObject |
98 | Compiled arg0 arg1 arg2 arg3 -> "tag" := "Compiled" ~> "arg0" := arg0 ~> "arg1" := arg1 ~> "arg2" := arg2 ~> "arg3" := arg3 ~> jsonEmptyObject | 154 | Compiled arg0 arg1 arg2 arg3 arg4 -> "tag" := "Compiled" ~> "arg0" := arg0 ~> "arg1" := arg1 ~> "arg2" := arg2 ~> "arg3" := arg3 ~> "arg4" := arg4 ~> jsonEmptyObject |
99 | 155 | ||
100 | instance decodeJsonCompileResult :: DecodeJson CompileResult where | 156 | instance decodeJsonCompileResult :: DecodeJson CompileResult where |
101 | decodeJson json = do | 157 | decodeJson json = do |
@@ -103,6 +159,10 @@ instance decodeJsonCompileResult :: DecodeJson CompileResult where | |||
103 | tag <- obj .? "tag" | 159 | tag <- obj .? "tag" |
104 | case tag of | 160 | case tag of |
105 | "CompileError" -> CompileError <$> obj .? "arg0" <*> obj .? "arg1" <*> obj .? "arg2" | 161 | "CompileError" -> CompileError <$> obj .? "arg0" <*> obj .? "arg1" <*> obj .? "arg2" |
162 | <<<<<<< f4af737a0d4a1fd3b3c6babc2c119129df34f77d | ||
106 | "Compiled" -> Compiled <$> obj .? "arg0" <*> obj .? "arg1" <*> obj .? "arg2" <*> obj .? "arg3" | 163 | "Compiled" -> Compiled <$> obj .? "arg0" <*> obj .? "arg1" <*> obj .? "arg2" <*> obj .? "arg3" |
107 | _ -> unsafeCrashWith "decodeJson @ CompileResult" | 164 | _ -> unsafeCrashWith "decodeJson @ CompileResult" |
165 | ======= | ||
166 | "Compiled" -> Compiled <$> obj .? "arg0" <*> obj .? "arg1" <*> obj .? "arg2" <*> obj .? "arg3" <*> obj .? "arg4" | ||
167 | >>>>>>> update type info to include warnings | ||
108 | 168 | ||