You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share one MySQL lexer between the rewriter and the placeholder scanner #249
The MySQL lexing rules (backslash escapes in strings, backtick identifiers, # comments, the ---needs-whitespace rule, live /*! bodies) are implemented twice: rewriteMySQLSQL in internal/transform/mysql_sql.go rewrites ? to pyformat at generation time, and placeholderSequence in internal/driver/common.go scans the rewritten text to order binding slots for reused sqlc.slice markers.
The two are kept in sync by tests that pin each rule on both sides, but a divergence silently misorders reused-slice arguments - review on #248 caught two such cases (odd-length dash runs, the \r line-end rule) before merge. A single shared scanner would remove the failure class entirely; the open question is where it lives, since transform and driver do not import each other today. An alternative is computing the placeholder sequence during the rewrite and carrying it on the IR, dropping the second lexer.
Activity