I've changed my mind about octal escapes.
The JSON5 spec says "\012" should decode as a <nil> byte followed by
"12", whereas C and dbTranslateEscape() decode it as a line-feed
character "\n". We probably don't want to get different values for the
VAL and DESC fields as would happen here if we don't do something:
record(stringin, s1) {
field(DESC, "\041") # "!" - dbTranslateEscape()
field(INP, {const:"\041"}) # "" - yajl
}
I now think the best solution is to drop support for octal character
escapes completely, and require strings to use \xXX hex escapes if they
can't use literal characters directly. I suspect octal escapes are very
rarely used now, and removing them would resolve this difference,
leaving just \a and \uXXXX to be decoded differently.
I will implement and document this change on my json5 branch.
--
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1783475
Title:
const link support can't handle escaped charactors
Status in EPICS Base:
Triaged
Status in EPICS Base 3.16 series:
Won't Fix
Status in EPICS Base 7.0 series:
Triaged
Bug description:
I think the following should work, but it doesn't. The culprit seems
to be the call to dbTranslateEscape() in dbRecordField() and
dbRecordInfo(). The escaped newline is handled correctly by dbLex,
but the later dbJLinkParse() errors on the now unescaped newline.
> record(stringin, "test") {
> field(INP, {const:"multi\nline"})
> }
> dbJLinkInit: lexical error: invalid character inside string.
> {"const":"multi line"}
> (right here) ------^
To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1783475/+subscriptions
- Navigate by Date:
- Prev:
Build failed: EPICS Base 7 base-7.0-55 AppVeyor via Core-talk
- Next:
Jenkins build became unstable: epics-7.0 » linux32 #245 APS Jenkins via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
[Bug 1783475] Re: const link support can't handle escaped charactors Andrew Johnson via Core-talk
- Next:
[Bug 1783475] Re: const link support can't handle escaped charactors Andrew Johnson via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
|