You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get a better resulting protobuf structure from return statements.
Problem
Currently, the grammar for return statement is
ret_stmt : RETURNTEXT;
which basically just parses anything next to the token return. The resulting json of the return statement is
{
"ret": {
"payload": "Anything next to the word return"
}
}
This makes it difficult to extract any information from the return statement. This also removes the ability to add modifiers which is allowed in the sysl grammar.
Purpose
To get a better resulting protobuf structure from return statements.
Problem
Currently, the grammar for return statement is
which basically just parses anything next to the token
return
. The resulting json of the return statement isThis makes it difficult to extract any information from the return statement. This also removes the ability to add modifiers which is allowed in the sysl grammar.
statements: ( ... | ret_stmt ... ) attribs_or_modifiers? ;
Suggested approaches
Allow a more restrictive grammar to return statements. Something like the following:
The token
TEXT
above needs to capture everything and stops until a square bracket to make way forattribs_or_modifiers
rule.The structure for
return
statement also needs to be improved.it needs to capture the type of return statement (
ok
,error
, andstatus_code
) and the payload (what is being returned).The text was updated successfully, but these errors were encountered: