lms-clean
lms-clean copied to clipboard
type check in printf function
should check the format string and the types of the given Defs
-- Parse the format string (list of characters) into an AST. -- Example: "%d,%s" → (FInt (FOther ',' (FString FEnd))) format : List Char -> Format format ('%' :: 'd' :: cs ) = FInt ( format cs ) format ('%' :: 's' :: cs ) = FString ( format cs ) format ( c :: cs ) = FOther c ( format cs ) format [] = FEnd
https://gist.github.com/chrisdone/672efcd784528b7d0b7e17ad9c115292