Open margaretha opened 1 month ago
So - the scope always contains the original for operation:override
? Wouldn't it then be better to have a rewrite like:
"rewrites" : [ {
"@type" : "koral:rewrite",
"src" : "Kustvakt",
"operation" : "operation:override",
"scope" : "context",
"src" : {
"left": [ "token", 40 ],
"right" : [ "token", 40 ]
}
}]
or:
"rewrites" : [ {
"@type" : "koral:rewrite",
"src" : "Kustvakt",
"operation" : "operation:override",
"scope" : "left",
"src" : [ "token", 60 ]
}, {
"@type" : "koral:rewrite",
"src" : "Kustvakt",
"operation" : "operation:override",
"scope" : "right"
"src" : [ "token", 60 ]
}]
Just scope
only makes sense for injections, right? That way it would be possible to "roll back" the rewrite.
And actually, both would work, so when the parser would understand the rewrites, it could be easily understand and actually "flatten" the rewrites to the query root.
Maximum token context should be configurable in Kustvakt as described in #745. It should be implemented in Kustvakt as a rewrite that overrides the context when the requested size is larger than the maximum.
Where should the rewrite notes be placed?
Within context
Within meta