bilibili / gengine

Other
1.95k stars 272 forks source link

常量 string 赋值中包含双引号转义错误 #23

Open matianjun1 opened 3 years ago

matianjun1 commented 3 years ago
rule "name test" "i can"  salience 0
begin
    name = "abc\"def"
end

外部获取 name 的值时 print 出来 为 abc\"def 而不是 abc"def

zhangzhen0370 commented 2 years ago
rule "name test" "i can"  salience 0
begin
name="a\\" // 这样写,是给name赋值为a\\了,理解为最外层的双引号中的字符串是没转义,写的是什么就是什么
//如果想要给name赋值为a\,规则写成name="a\",在规则编译是报错:build rule from string err: [line 6:8 mismatched input '60' expecting END。
// 现有的引擎无法满足此种需求。望作者改进,谢谢。
end
OctoberCity commented 1 year ago

支持字符串转义吗?比如支持 ` 替代外层的“