fix var minify collisions with reserved words
This commit is contained in:
parent
5a34d8c39e
commit
c5f505462f
1 changed files with 12 additions and 8 deletions
|
|
@ -289,8 +289,11 @@ void minify_var(_obj* in, std::regex const& exclude)
|
||||||
strmap_t varmap;
|
strmap_t varmap;
|
||||||
// get vars
|
// get vars
|
||||||
varmap_get(in, exclude);
|
varmap_get(in, exclude);
|
||||||
|
// concatenate excluded and reserved
|
||||||
|
concat_sets(excluded, m_excluded_var);
|
||||||
|
concat_sets(excluded, all_reserved_words);
|
||||||
// create mapping
|
// create mapping
|
||||||
varmap=gen_minimal_map(m_vars, m_excluded_var);
|
varmap=gen_minimal_map(m_vars, excluded);
|
||||||
// perform replace
|
// perform replace
|
||||||
recurse(r_replace_var, in, &varmap);
|
recurse(r_replace_var, in, &varmap);
|
||||||
require_rescan_var();
|
require_rescan_var();
|
||||||
|
|
@ -299,19 +302,20 @@ void minify_var(_obj* in, std::regex const& exclude)
|
||||||
void minify_fct(_obj* in, std::regex const& exclude)
|
void minify_fct(_obj* in, std::regex const& exclude)
|
||||||
{
|
{
|
||||||
// countmap_t fcts, cmdmap;
|
// countmap_t fcts, cmdmap;
|
||||||
set_t allcmds, excluded, unsets;
|
set_t excluded, unsets;
|
||||||
strmap_t fctmap;
|
strmap_t fctmap;
|
||||||
// get fcts and cmds
|
// get fcts and cmds
|
||||||
fctmap_get(in, exclude);
|
fctmap_get(in, exclude);
|
||||||
cmdmap_get(in, regex_null);
|
cmdmap_get(in, regex_null);
|
||||||
recurse(r_get_unsets, in, &unsets);
|
recurse(r_get_unsets, in, &unsets);
|
||||||
// concatenate cmds and excluded commands
|
// concatenate cmds, excluded and reserved
|
||||||
allcmds=map_to_set(m_cmds);
|
excluded=map_to_set(m_cmds);
|
||||||
concat_sets(allcmds, m_excluded_fct);
|
exclude_sets(excluded, map_to_set(m_fcts));
|
||||||
concat_sets(allcmds, unsets);
|
concat_sets(excluded, m_excluded_fct);
|
||||||
|
concat_sets(excluded, unsets);
|
||||||
|
concat_sets(excluded, all_reserved_words);
|
||||||
// create mapping
|
// create mapping
|
||||||
concat_sets(allcmds, all_reserved_words);
|
fctmap=gen_minimal_map(m_fcts, excluded);
|
||||||
fctmap=gen_minimal_map(m_fcts, allcmds);
|
|
||||||
// perform replace
|
// perform replace
|
||||||
recurse(r_replace_fct, in, &fctmap);
|
recurse(r_replace_fct, in, &fctmap);
|
||||||
require_rescan_fct();
|
require_rescan_fct();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue