Skip to content

SYNG3006 - Replacement causes syntax error

Domain: ops
Severity: USER

A replacement would produce invalid syntax in the target file.

After applying the replacement, the resulting code would have syntax errors. SYNG validates replacements to prevent breaking your code.

Example

clojure
(:replace (str) "")

Replacing the string with empty text would produce print() which may be valid, but replacing in a context like x = "hello" would produce x = which is a syntax error.

Solution

Adjust your replacement to produce valid syntax:

  1. Check that the replacement text is syntactically valid in context
  2. Consider whether you need to replace a larger node to maintain validity
  3. Use --force to apply replacements anyway (at your own risk)

The error message will indicate which specific replacement caused the syntax error.

SYNG3004, SYNG3005

Copyright © 2022-present Semantic Works, Inc.