Closed smizell closed 2 years ago
Deploy preview for specification ready!
✅ Preview https://specification-31d5ta847-superface.vercel.app
Built with commit a80ecedfa0c5b41fa383aa9ebd13532652908b41. This pull request is being automatically deployed with vercel-action
@zdne @TheEdward162 I've made a few changes here.
StringLiteral
. I just put a /./
for now. It feels like there's a lot there to think about, from escaped quotes, tabs, new lines, etc. What do you think it should be?LHS
from the maps. Is this correct?ArrayLiteral
It's getting closer, but not quite there IMO.
@smizell
StringLiteral
It is implemented to parse exactly the same thing as StringValue
does in maps right now. I think that is reasonable and I think we should put that in the spec.
LHS
Huh, it seems like it's wrong in the map spec - it should allow strings after .
- i.e. the rule should be:
VariableKeyPath[ObjectVariable] : `.`VariableName
Otherwise it's correct, the parsing is implemented the same way as in maps.
ArrayLiteral
👍
We parse numbers in these places:
EnumModel
in profiles (the optional enum value assignment) - the value is called ScalarValue
and is not defined anywhere (we should fix that)HTTPCall
in maps, the response handler status code - the value leads to IntegerValue
which only defined base10 integersIn reality the full supported syntax is something like this (it just kind of happened to be implemented so that's why it's not specced anywhere):
NumberLiteral: NumberSign? NumberLiteralDigits
NumberSign : `-` | `+`
NumberLiteralDigits : NumberLiteralInteger | NumberLiteralFloat
NumberLiteralInteger : NumberLiteralIntegerBase10 | NumberLiteralIntegerBase2 | NumberLiteralIntegerBase8 | NumberLiteralIntegerBase16
NumberLiteralIntegerBase10 : DigitBase10+
NumberLiteralIntegerBase2 : 0b DigitBase2+
NumberLiteralIntegerBase8 : 0o DigitBase8+
NumberLiteralIntegerBase16 : 0x DigitBase16+
DigitBase10 : /[0-9]/
DigitBase2 : /[0-1]/
DigitBase8 : /[0-7]/
DigitBase16 : /[0-9a-fA-F]/
NumberLiteralFloat : DigitBase10+ . DigitBase10+
Example support in profile spec.