lms-clean icon indicating copy to clipboard operation
lms-clean copied to clipboard

type check in printf function

Open feiwang3311 opened this issue 4 years ago • 1 comments

should check the format string and the types of the given Defs

feiwang3311 avatar Jun 20 '20 00:06 feiwang3311

-- 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

feiwang3311 avatar Jun 20 '20 00:06 feiwang3311