refactor type-literal to use ast
refactor parser futher to use AST