mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 11:57:51 +00:00
Disabled unquoting for single quoted attribute values; updated test
This commit is contained in:
parent
e9c1606a9d
commit
1e30a9372d
3 changed files with 13 additions and 14 deletions
|
|
@ -88,7 +88,7 @@ func TestParser_Parse(t *testing.T) {
|
|||
"bool0": true,
|
||||
"bool1": false,
|
||||
"x": nil,
|
||||
"escape": `\" \\escape\n`,
|
||||
"escape": "\" \\escape\n",
|
||||
},
|
||||
},
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ item <- ( 'null' &(comma / sp close) { p.addVal(nil) }
|
|||
/ < '-'? '.'[0-9]+ > { p.addNumVal(buffer[begin:end]) }
|
||||
/ < ([[A-Z]] / [0-9] / '-' / '_' / ':')+ > { p.addVal(buffer[begin:end]) }
|
||||
/ < '"' doublequotedstring '"' > { s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }
|
||||
/ < '\'' singlequotedstring '\'' > { s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }
|
||||
/ '\'' < singlequotedstring > '\'' { p.addVal(buffer[begin:end]) }
|
||||
)
|
||||
|
||||
doublequotedstring <- ( '\\\"' / [^"] )*
|
||||
|
|
|
|||
|
|
@ -486,8 +486,7 @@ func (p *PQL) Execute() {
|
|||
s, _ := strconv.Unquote(buffer[begin:end])
|
||||
p.addVal(s)
|
||||
case ruleAction41:
|
||||
s, _ := strconv.Unquote(buffer[begin:end])
|
||||
p.addVal(s)
|
||||
p.addVal(buffer[begin:end])
|
||||
case ruleAction42:
|
||||
p.addField(buffer[begin:end])
|
||||
case ruleAction43:
|
||||
|
|
@ -1723,7 +1722,7 @@ func (p *PQL) Init() {
|
|||
position, tokenIndex = position136, tokenIndex136
|
||||
return false
|
||||
},
|
||||
/* 13 item <- <(('n' 'u' 'l' 'l' &(comma / (sp close)) Action34) / ('t' 'r' 'u' 'e' &(comma / (sp close)) Action35) / ('f' 'a' 'l' 's' 'e' &(comma / (sp close)) Action36) / (<('-'? [0-9]+ ('.' [0-9]*)?)> Action37) / (<('-'? '.' [0-9]+)> Action38) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action39) / (<('"' doublequotedstring '"')> Action40) / (<('\'' singlequotedstring '\'')> Action41))> */
|
||||
/* 13 item <- <(('n' 'u' 'l' 'l' &(comma / (sp close)) Action34) / ('t' 'r' 'u' 'e' &(comma / (sp close)) Action35) / ('f' 'a' 'l' 's' 'e' &(comma / (sp close)) Action36) / (<('-'? [0-9]+ ('.' [0-9]*)?)> Action37) / (<('-'? '.' [0-9]+)> Action38) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action39) / (<('"' doublequotedstring '"')> Action40) / ('\'' <singlequotedstring> '\'' Action41))> */
|
||||
func() bool {
|
||||
position140, tokenIndex140 := position, tokenIndex
|
||||
{
|
||||
|
|
@ -2082,21 +2081,21 @@ func (p *PQL) Init() {
|
|||
goto l142
|
||||
l193:
|
||||
position, tokenIndex = position142, tokenIndex142
|
||||
if buffer[position] != rune('\'') {
|
||||
goto l140
|
||||
}
|
||||
position++
|
||||
{
|
||||
position196 := position
|
||||
if buffer[position] != rune('\'') {
|
||||
goto l140
|
||||
}
|
||||
position++
|
||||
if !_rules[rulesinglequotedstring]() {
|
||||
goto l140
|
||||
}
|
||||
if buffer[position] != rune('\'') {
|
||||
goto l140
|
||||
}
|
||||
position++
|
||||
add(rulePegText, position196)
|
||||
}
|
||||
if buffer[position] != rune('\'') {
|
||||
goto l140
|
||||
}
|
||||
position++
|
||||
{
|
||||
add(ruleAction41, position)
|
||||
}
|
||||
|
|
@ -2909,7 +2908,7 @@ func (p *PQL) Init() {
|
|||
nil,
|
||||
/* 76 Action40 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */
|
||||
nil,
|
||||
/* 77 Action41 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */
|
||||
/* 77 Action41 <- <{ p.addVal(buffer[begin:end]) }> */
|
||||
nil,
|
||||
/* 78 Action42 <- <{ p.addField(buffer[begin:end]) }> */
|
||||
nil,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue