@@ -436,10 +436,10 @@ TCVB 格式规范:
4364361. 所有OPERATION操作以行为单位
4374372. 一个'## FILE'下可以有多个'## OPERATION'
4384383. 锚点为连续的多行内容:使用至少3行唯一文本作为锚点,用来标定范围,防止混淆(如果需要可以超过3行)
439- 4. [markdown代码块], 一定要用\`\`\` ... \`\`\` 包裹,仔细检查不要漏掉
439+ 4. [markdown代码块], 一定要用\`\`\` ... \`\`\` 包裹,仔细检查不要漏掉。
4404405. 注意TCVB和CVB的区别。CVB是完整的内容,而TCVB是用来生成差量同步的,通过多个OPERATION去操作已有CVB合成新CVB
4414416. 插入和删除操作都可以转化为替换操作
442- 7. 用来匹配的锚点必须和原始传入的数据一致 ,不能有缺失,比如不能丢弃注释 。
442+ 7. 用来匹配的锚点必须和原始传入的数据完全一致 ,不能有缺失,不能丢弃注释 。
443443` ;
444444 }
445445}
@@ -501,7 +501,7 @@ function applyExactReplace(strContent: string, op: ExactReplaceOperation): strin
501501
502502 regPattern . lastIndex = 0 ; // 重置正则表达式的状态
503503 if ( ! regPattern . test ( strContent ) ) {
504- console . log ( "以下表达式:\n" + regPattern + "\n 为何无法匹配到原文 :\n" + strContent ) ;
504+ console . log ( "以下表达式:\n" + regPattern + "\n 无法匹配 :\n" ) ;
505505 throw new Error ( `Exact-replace操作失败:文件 "${ op . m_strFilePath } " 中未找到匹配项。请检查前后锚点及旧内容是否正确。` ) ;
506506 }
507507 regPattern . lastIndex = 0 ; // 再次重置以备替换
@@ -520,7 +520,7 @@ function applyGlobalReplace(strContent: string, op: GlobalReplaceOperation) : st
520520
521521 regPattern . lastIndex = 0 ;
522522 if ( ! regPattern . test ( strContent ) ) {
523- console . log ( "以下表达式:\n" + regPattern + "\n 为何无法匹配到原文:\n" + strContent ) ;
523+ console . log ( "以下表达式:\n" + regPattern + "\n 无法匹配" ) ;
524524 throw new Error ( `全局替换失败:文件 "${ op . m_strFilePath } " 中未找到旧内容 "${ op . m_strOldContent } "。` ) ;
525525 }
526526 regPattern . lastIndex = 0 ;
0 commit comments