summaryrefslogtreecommitdiff
path: root/Definitions.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Definitions.hs')
-rw-r--r--Definitions.hs64
1 files changed, 64 insertions, 0 deletions
diff --git a/Definitions.hs b/Definitions.hs
index 743c233..d4b69be 100644
--- a/Definitions.hs
+++ b/Definitions.hs
@@ -428,3 +428,67 @@ ir = execWriter $ do
428 , "streams" #:: Array "StreamData" 428 , "streams" #:: Array "StreamData"
429 , "commands" #:: Array "Command" 429 , "commands" #:: Array "Command"
430 ] 430 ]
431
432mesh = execWriter $ do
433 data_ "MeshAttribute" $ do
434 const_ "A_Float" [Array Float]
435 const_ "A_V2F" [Array v2f]
436 const_ "A_V3F" [Array v3f]
437 const_ "A_V4F" [Array v4f]
438 const_ "A_M22F" [Array m22]
439 const_ "A_M33F" [Array m33]
440 const_ "A_M44F" [Array m44]
441 const_ "A_Int" [Array Int32]
442 const_ "A_Word" [Array Word32]
443
444 data_ "MeshPrimitive" $ do
445 enum_ "P_Points"
446 enum_ "P_TriangleStrip"
447 enum_ "P_Triangles"
448 const_ "P_TriangleStripI" [Array Int32]
449 const_ "P_TrianglesI" [Array Int32]
450
451 data_ "Mesh" $ do
452 constR_ "Mesh"
453 [ "mAttributes" #:: Map String "MeshAttribute"
454 , "mPrimitive" #:: "MeshPrimitive"
455 ]
456
457typeInfo = execWriter $ do
458 data_ "TypeInfo" $ do
459 constR_ "TypeInfo"
460 [ "startLine" #:: Int
461 , "startColumn" #:: Int
462 , "endLine" #:: Int
463 , "endColumn" #:: Int
464 , "text" #:: String
465 ]
466
467 data_ "MyEither" $ do
468 const_ "MyLeft" ["TypeInfo", Array "TypeInfo"]
469 const_ "MyRight" ["TypeInfo"{- "Pipeline" -}, Array "TypeInfo"]
470
471{-
472type TypeInfoRecord =
473 { startLine :: Int
474 , startColumn :: Int
475 , endLine :: Int
476 , endColumn :: Int
477 , text :: String
478 }
479data TypeInfo = TypeInfo TypeInfoRecord
480
481instance decodeJsonTypeInfo :: DecodeJson TypeInfo where
482 decodeJson json = do
483 obj <- decodeJson json
484 startL <- obj .? "startL"
485 startC <- obj .? "startC"
486 endL <- obj .? "endL"
487 endC <- obj .? "endC"
488 text <- obj .? "text"
489 return $ TypeInfo {startLine:startL, startColumn:startC, endLine:endL, endColumn:endC, text:text}
490
491data MyEither
492 = MyLeft TypeInfo (Array TypeInfo)
493 | MyRight Pipeline (Array TypeInfo)
494-} \ No newline at end of file