sweet-core
sweet-core copied to clipboard
Add back --readable-names flag
By default hygiene gives all bindings a new name with _<number>
appended to it. In most cases you can just drop the unique suffix; it is only needed in cases where multiple bindings with the same name mix. In pre 1.0 the --readable-names
flag did this.
Adding it back now is probably much easier with the Shift scope analyser.
This discussion has probably happened elsewhere but any reason not to make the --readable-names
behavior the default instead and provide a flag to uniquify everything if they want that?
Ah good call. That's probably a better default.
+1
Doesn't seem to have been addressed. A "fix" which probably breaks things but works for me is in my branch https://github.com/gkovacs/sweet.js at https://github.com/gkovacs/sweet.js/commit/94f637476f0d8a74f37a5047491a3e55a9b4aec6
@gkovacs indeed that will avoid the renaming but hygiene is obviously broken now.
yes I mean obviously the system should optimally check to see if a rename is required and only rename if necessary. none of my macros declare new variables so it seems to work for my purposes.