-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Extend *.eskip format with basic abstraction facilities #182
Comments
this is awesome! i am only not sure about these two: "An identifier for a user-defined filter chain MUST start with a lowercase latin character." while it's very Goish, not sure that users would expect it. Need to consider this. Any suggestions, opinions, wishes? |
I agree with @aryszka that this looks like Go and it is something the could be counter intuitive in something that is not directly Go. |
I'm happy to drop this requirement, but my idea here was that it would help to statically verify the routes. Otherwise it will either be a "dumb" macro or we will have to carry types through expansion, which is a bit complicated. However it also might be that I'm totally missing something :) |
can they be verified like this? |
@aryszka That is true, however For now, I always want to catch as many errors as I can before going into production. |
still considering this. I would like it if it was possible to differentiate between a predicate definition and a filter definition. I just don't have a syntax solution on my mind that I would like as a user. Sofar. |
@aryszka We could ask for community input here. I proposed on a different issue a "feedback wanted" label. |
@aryszka Which could result in something like this:
|
The following proposal is to implement several abstraction facilities to *.eskip format. The focus is to have minimal changes to the syntax of the files and introduce bare minimum extra grammar.
Example
Specification
User-defined constants
A constant MUST be able to represent the following base types:
Each constant identifier MUST be prefixed with
$
. A constant definition MUST consist of an identifier and it's value separated by:
and terminated by;
located at the top level in an eskip file:Constants are global and MUST have a globally unique name. A conflict in names MUST be reported by the
eskip check
command.User-defined filter chains
A user-defined filter chain has the same syntax as the route, but MUST have a parameter list enclosed in round braces following the identifier. Parameter list MUST contain zero or more parameters. Each parameter MUST be a locally-bound constant.
The body of the filter chain MUST consist of one or more filter "calls", separated by
->
:Any violations of on of the following conditions MUST be reported by the
eskip check
command:User-defined predicates
User-defined predicates have the same syntax as the route, but MUST have a parameter list enclosed in round braces following the identifier. Parameter list MUST contain zero or more parameters. Each parameter MUST be a locally-bound constant.
The body of the predicate MUST consist of one or more predicate "calls", separated by
&&
:Any violations of on of the following conditions MUST be reported by the
eskip check
command:The text was updated successfully, but these errors were encountered: