superfaceai / spec

The Comlink Specification. Comlink is a new interface description and integration language build self-integrating applications.
https://superface.ai/docs/comlink/specification
MIT License
11 stars 1 forks source link

First attempt at example support in profiles #36

Closed smizell closed 2 years ago

smizell commented 3 years ago

Example support in profile spec.

github-actions[bot] commented 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

smizell commented 2 years ago

@zdne @TheEdward162 I've made a few changes here.

It's getting closer, but not quite there IMO.

TheEdward162 commented 2 years ago

@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

👍

Numbers

We parse numbers in these places:

In 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+