Skip to content

Conversation

@p-v-l-v
Copy link

@p-v-l-v p-v-l-v commented Aug 11, 2025

Memoization bug fixed - Now handles any number of parameters
Redundant transformation removed - Duplicate match gsub was unnecessary
The autoquote.py bug fixed. The solution implements proper string-aware parsing with three helper functions:

  1. remove_comments_preserve_strings() - Removes comments while preserving string
    content
  2. extract_tokens_outside_strings() - Extracts tokens only from code, not strings
  3. quote_symbols_outside_strings() - Quotes symbols without touching string literals

The fix ensures that:

  • Semicolons in string literals work correctly
  • Comments after semicolons are still removed
  • Symbols inside strings are never quoted
  • All edge cases (escaped quotes, multiple semicolons) are handled

Fixed the memoized function to handle multiple parameters using lambda args and apply
 Removed duplicate gsub(/\(match /, "(Match ") transformation
@p-v-l-v p-v-l-v changed the title Memoization bug, redundant transformation Memoization bug, redundant transformation, semicolon bug Aug 11, 2025
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

Successfully merging this pull request may close these issues.

1 participant