tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

sourceMapBuildNamed.tri (845B)


      1 !import "source.map" !Local
      2 !import "parser" !Local
      3 !import "prelude" !Local
      4 !import "io" !Local
      5 root = "__ROOT__"
      6 overlay = "__OVERLAY__"
      7 compiler = "__COMPILER__"
      8 mapPath = "__MAP__"
      9 name = "__NAME__"
     10 main = io (onResult_ (readFile mapPath)
     11   (problem : putStrLn (append "map-read-failed: " problem))
     12   (mapBytes : onResult_
     13     (sourceMapBuild "." overlay root compiler mapBytes name)
     14     (problem : thenIO
     15       (putStrLn (append "map-diagnostic-code="
     16         (showNumber (parserDiagnosticCode problem))))
     17       (putStrLn (append "map-diagnostic-offset="
     18         (showNumber (snd (snd (parserDiagnosticLocation problem)))))))
     19     (result : thenIO
     20       (putStrLn (append "manifest=" (fst (fst result))))
     21       (thenIO (putStrLn (append "module-receipt=" (snd (fst result))))
     22         (putStrLn (append "map-receipt=" (snd result)))))))
     23 main