Add lexer and fix item closure generator