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

type check in printf function #20

Open
feiwang3311 opened this issue Jun 20, 2020 · 1 comment
Open

type check in printf function #20

feiwang3311 opened this issue Jun 20, 2020 · 1 comment

Comments

@feiwang3311
Copy link
Collaborator

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

@feiwang3311
Copy link
Collaborator Author

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

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

No branches or pull requests

1 participant