language-haskell
language-haskell copied to clipboard
Feature request: syntax highlighting for .dump-stg and .dump-simpl files
I'll be great to have such highlighting and it'll help debugging.
I mean files that are generated with -ddump-simpl and -ddump-stg GHC flags.
If there is a formal syntax definition somewhere out there, I might take a look. Otherwise, not very likely in the near future.
It's not well documented, but -ddump-stg generate some basic syntax, that could be used. Like: `
==================== STG syntax: ==================== 2016-11-15 21:26:07.5810105 UTC
add :: forall a. Num a => a -> a -> a = \r srt:SRT:[] [$dNum a1 b] + $dNum a1 b;
main2 :: [Char] = \u srt:SRT:[] [] unpackCString# "hello world"#;
main1 :: State# RealWorld -> (# State# RealWorld, () #) = \r srt:SRT:[rzi :-> hPutStr2, rAy :-> stdout, r1Dw :-> main2] [eta] hPutStr2 stdout main2 True eta;
main :: IO () = \r srt:SRT:[r1Dv :-> main1] [eta] main1 eta;
main3 :: State# RealWorld -> (# State# RealWorld, () #) = \r srt:SRT:[rUd :-> runMainIO1, r1Dv :-> main1] [eta] runMainIO1 main1 eta;
main :: IO () = \r srt:SRT:[r1Dx :-> main3] [eta] main3 eta;
$trModule2 :: TrName = NO_CCS TrNameS! ["main"#];
$trModule1 :: TrName = NO_CCS TrNameS! ["Main"#];
$trModule :: Module = NO_CCS Module! [$trModule2 $trModule1]; `
Not everything could be colored. May be types, names, type constructors and unboxed types (with sharp symbol) will be great start!