-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix parse string #57314
fix parse string #57314
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/pir/core/parser/lexer.cc
Outdated
if (c == '\\') { | ||
c = GetChar(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只考虑转义引号就可以了
|
||
//CHECK attribute | ||
(Array)[(Double)1,(Int64)0,(String)1] | ||
(Array)[(Double)1,(Int64)0,"1"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Array)[(Double)1,(Int64)0,"1"] | |
[(Double)1,(Int64)0,"1"] |
接下来还需要优化下针对Array的parser,跟String类似,我们通过[]应该就可以识别,感觉没必要加一个Array,比较累赘
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外针对String Attribute补充一些测试用例吧,比如
(Array)[(Double)1,(Int64)0,"1"] | |
“\“” | |
"\\"" | |
"\\\"" | |
"\t\r\n\"" |
之类的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix parse string * fix parse string * fix string * fix string * fix string * fix string * fix codestyle * fix string * fix parse string --------- Co-authored-by: xingmingyyj <zxm_3719@163.com>
* fix parse string * fix parse string * fix string * fix string * fix string * fix string * fix codestyle * fix string * fix parse string --------- Co-authored-by: xingmingyyj <zxm_3719@163.com>
* fix parse string * fix parse string * fix string * fix string * fix string * fix string * fix codestyle * fix string * fix parse string --------- Co-authored-by: xingmingyyj <zxm_3719@163.com>
PR types
Others
PR changes
Others
Description
修改StringAttribute的print和parse方式,StringAttribute的值按\“StringVal\”的形式print,如果StringVal中含有字符",进行转义,按"方式输出
在
test/cpp/pir/core/TestParserText.txt
给出样例