adonais / skylark

Skylark Editor is written in C, a high performance text/hex editor. Embedded Database-client/Redis-client/Lua-engine. You can run Lua scripts and SQL files directly.
https://sourceforge.net/projects/libportable/files/Skylark/
GNU General Public License v3.0
453 stars 44 forks source link

批处理中的语法识别问题 #76

Closed kidzgy closed 1 year ago

kidzgy commented 1 year ago

    for /f "delims== tokens=2*" %%i in ('findstr /i /c:"var sourceRoot" "%~1\%%a"') do (
        set sourceRoot=%%i
        set sourceRoot=!sourceRoot:~2,-2!
        set htmlName=%%a
        set htmlName2=!htmlName:~0,-5!
    )
>>"%~1.html" (findstr /i "D.p([" "%~1\!htmlName!" | sed.exe -r "1s#(D.p\(\[\x22)[^^*]+\*0#\1!htmlName2!\*0#gi" | sed.exe -r "s#(D.p\(\[\x22)!sourceRoot!#\1!htmlName2!\/#gi")
)

以上是节选部分的测试代码。

微信截图_20230817094639 微信截图_20230817094054

在与Everedit的比较中,可以发现Everedit完美识别了多重式子的括号匹配问题。 【findstr /i "D.p(["】 内容中的【"D.p(["】其实是段文本,所以里面的括号什么的,就不应该与外界的括号形成匹配。

yxl0756 commented 1 year ago

这是上游scintilla语法解析器的bug, 影响所有基于scintilla的编辑器, 建议你直接到 https://sourceforge.net/p/scintilla/bugs/ 向作者反应bug, 一般来说解决问题的速度会很快.

yxl0756 commented 1 year ago

我提交了bug, 如果他们一段时间没动静我就着手修复.

kidzgy commented 1 year ago

261230996-7ceee54f-de90-41e7-bf95-0ced683ade5b 我发现sublime text的高亮方案更好!