Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: syntax highlighting for .dump-stg and .dump-simpl files #94

Open
varosi opened this issue Nov 2, 2016 · 2 comments
Open

Comments

@varosi
Copy link

varosi commented Nov 2, 2016

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.

@lierdakil
Copy link
Contributor

If there is a formal syntax definition somewhere out there, I might take a look. Otherwise, not very likely in the near future.

@varosi
Copy link
Author

varosi commented Nov 15, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants