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

Too many variables injected into scope #56

Open
meric opened this issue Apr 15, 2017 · 0 comments
Open

Too many variables injected into scope #56

meric opened this issue Apr 15, 2017 · 0 comments

Comments

@meric
Copy link
Owner

meric commented Apr 15, 2017

List of variables injected in l2l: Args, BinOp, Block, Chunk, Comment, Exp, ExpList, Field, FieldList, FieldSep, FuncBody, FuncName, FunctionCall, FunctionDef, Label, LiteralString, LongString, Lua, Name, NameList, NameOrLispExp, Numeral, ParList, PrefixExp, RetStat, Stat, TableConstructor, UnOp, Var, VarList, _37, _42, _43, _45, _47, _60, _60_61, _61_61, _62, _62_61, _dot_dot, and_97_110_100, apply, build, call, compile, compiler, compose, contains, copy, destructure, dotmap, each, environ, error_handler, escape, expand, expize, factor, filter, hasmetatable, import, import_extension, inherit, initialize_dependencies, inserts, ipairs, is_space, isalpha, isalphanumeric, keys, len, list, load_extension, loadstring, lua_annotated, lua_args, lua_assign, lua_ast, lua_binop, lua_binop_exp, lua_block, lua_break, lua_chunk, lua_colon_functioncall, lua_comment, lua_do, lua_dot, lua_else, lua_elseif, lua_elseifs, lua_explist, lua_false, lua_field_key, lua_field_name, lua_fieldlist, lua_for, lua_for_in, lua_funcbody, lua_funcname, lua_function, lua_functioncall, lua_goto, lua_if, lua_index, lua_inline_functioncall, lua_label, lua_lambda_function, lua_lazy, lua_local, lua_local_function, lua_long_comment, lua_name, lua_nameize, lua_namelist, lua_nil, lua_none, lua_paren_exp, lua_repeat, lua_retstat, lua_semicolon, lua_step, lua_string, lua_table, lua_true, lua_unop, lua_unop_exp, lua_vararg, lua_varlist, lua_while, mangle, map, not_110_111_116, numeral, or_111_114, prototype, read, read_dict, read_list, read_lua, read_lua_literal, read_quote, read_right_brace, read_right_paren, read_symbol, reader, rep, reverse, set_sourcemap_to, skip_whitespace, spaces, spacing, span, statize, symbol, term, to_stat, torepresentation, trace, unpack, vector

There are many variables injected into scope. A lot of them have to be in there because of the way quoted lua ast nodes become compiled into Lua. IMO good idea to think of a way to reduce possibility of l2l and user names conflicting. At the same time a lot aren't necessary. (e.g. the ones starting with capital letter). List the necessary ones explicitly in compiler.initialize_dependencies instead of wholesale injecting everything available in those modules.

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