| name | yylib-operator-removal |
| description | Manually remove yylib custom operator declarations and their supporting definitions from the Yuyan codebase, without Python or automated rewrites. |
Yylib Operator Removal
Use this skill when removing first-class/custom operators from yylib and replacing their uses with ordinary function calls, constructors, or compiler builtins.
Hard Rules
- Work manually. Use
rg, sed, nl, and file reads to inspect; use apply_patch for edits.
- Do not use Python. Do not write Python scripts, one-off Python snippets, or Python-based rewrites.
- Do not use broad automated rewrites. This migration is syntax-sensitive and must be reviewed case by case.
- Ignore
*_v0 directories unless the user explicitly asks.
- Follow repository instructions about verification. In this repo, do not run compiler checks, tests, lint, formatting, build commands, or smoke tests unless the user explicitly asks.
- Always review changes afterwards with
git diff and targeted rg searches.
Exact Operator Shapes
An operator declaration in yylib has this shape:
ๆฏ<operator-form>ไบค<assoc>ๅบ<precedence>ไนใ
Where:
<operator-form> contains one or more operand holes written as ใ, or may be a no-hole form such as ใใ.
<assoc> is ๅทฆ, ๅณ, or ๆ .
<precedence> is written in Chinese digits, for example ไธ้ถ้ถ, ๅ
ญๅ
ซไน, ไธไธ้ถ.
Examples:
ๆฏใ+ใไบคๅทฆๅบไธ้ถ้ถไนใ
ๆฏใ่กใไบคๅณๅบไธ้ถ้ถไนใ
ๆฏใใไบคๆ ๅบไธไธ้ถไนใ
ๆฏไปฅใๅๅนถใไบคๆ ๅบไธ้ถ้ถไนใ
The declaration is usually paired with one or more supporting forms nearby:
ใ+ใไนๅใๆดๆฐใ่ๅใๆดๆฐใ่ใๆดๆฐใไนใ
ใใ+ใใ่
ใๅ ใไนใ
ๆฏใ+ใไบคๅทฆๅบไธ้ถ้ถไนใ
Other common supporting forms:
ใใ่กใใๅณใๅคใไนใ
ใใใไน๏ผๆฟใๅ
็ฑปๅใ่
ใ็ฒใ่ๅใ็ฒใ่ใ็ฒใๅ๏ผไนใ
ใใใใใ่
ไผใ็ฒใ่ใๅคใไบใ็ฒใไบใ็ฉบใไนใ
ๅฏๆใๅณใๅฏๆใไนใ
When removing an operator, remove or rewrite the whole operator surface, not only the ๆฏ... line.
Current yylib Operator Set
At the time this skill was written, the active yylib operators are:
ใๅ
ถใ
ใๅคงไบใ
ใ=ใ
ใ็ญไบใ
ใไธ็ญไบใ
ใๅฐไบใ
ใ+ใ
ใๅ ใ
ใ-ใ
ใๅใ
ใไธใ
ๆๅฏๆใ
ๅฏๆใ
ใๅ
ๅ
ใใ
ใ่กใ
ใใใ
ใใ๏ผใใ
ใใ๏ผใ๏ผใใ
ใใ๏ผใ๏ผใ๏ผใใ
ใใ๏ผใ๏ผใ๏ผใ๏ผใใ
ใ@ใ
ใๆฅใ
ไปฅใๅๅนถใ
ใไธบใๅญๅญ็ฌฆไธฒ
ใๆฏใ็็ปๅฐพ
ใๆฏใ็ๅผๅคด
ไปฅใๅๅนถๅใ
Before editing, relist the current set with:
rg -n --glob '!**/*_v0/**' '^\s*ๆฏ.*ไบค.*ๅบ.*ไนใ' yylib
Manual Removal Workflow
- Identify the operator declaration:
rg -n --glob '!**/*_v0/**' '^\s*ๆฏ.*ไบค.*ๅบ.*ไนใ' yylib
- Inspect the surrounding code manually:
sed -n '<start>,<end>p' <file>
- Find all uses of the operator form before removing it. Search both quoted and unquoted forms when applicable:
rg -n --glob '!**/*_v0/**' '<operator text>|ใ<operator text>ใ|<plain alias>' .
- Rewrite uses by hand. Prefer existing named functions or constructors:
็ฒ + ไน -> ใๅ ใไบใ็ฒใไบใไนใ or the local named equivalent.
็ฒ ๅ ไน / ็ฒ - ไน -> ใๅใไบใ็ฒใไบใไนใ.
็ฒ ่ก ไน -> ใๅคใไบใ็ฒใไบใไนใ when this is cons, not append.
็ฒ @ ไน / ็ฒ ๆฅ ไน -> ใ้ๅ ใไบใ็ฒใไบใไนใ.
ไปฅใๅ้็ฌฆใๅๅนถใๅใ -> ใไปฅใๅๅนถใใไบใๅ้็ฌฆใไบใๅใ only as an interim step if the operator binding still exists; otherwise rename the function first.
ใ้ใ should not be reintroduced in yylib; string concatenation is a compiler builtin.
- Remove the operator declaration and its operator-facing support:
- Remove
ๆฏ...ไบค...ๅบ...ไนใ.
- Remove the operator type judgment such as
ใ+ใไน...ไนใ if it exists only for the operator.
- Remove the quoted operator definition such as
ใใ+ใใ่
...ไนใ if it exists only for the operator.
- Remove alias declarations such as
ใใ่กใใๅณ...ไนใ if they are only there to expose the operator.
- Keep the ordinary named function or constructor if other code still uses it.
- Review manually:
git diff -- <changed files>
rg -n --glob '!**/*_v0/**' '^\s*ๆฏ.*ไบค.*ๅบ.*ไนใ' yylib
rg -n --glob '!**/*_v0/**' '<removed operator text>|ใ<removed operator text>ใ' .
The goal of review is to catch:
- dangling operator declarations
- dangling operator type judgments
- dangling quoted operator definitions
- remaining uses of removed syntax
- accidental edits inside string literals or field labels
- accidental changes in
*_v0 directories
Things Not To Do
- Do not replace every
ใ pattern mechanically. Some are active builtins, parser syntax, or documentation.
- Do not remove ordinary named functions just because an operator wrapper used them.
- Do not edit generated build artifacts such as
.yybuild*, binaries, or logs.
- Do not run verification commands unless explicitly asked.