abstract captures into vars
move vars validation into parsing
add file and line in generated code