-
Notifications
You must be signed in to change notification settings - Fork 41
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
False error from KaSa: mod, tokens, <-
#661
Comments
With compound perturbations, weird things occur. The snapshot is not present; and KaSim CLI will refuse to run the model... |
Dear Hector, |
%mod: [T] > 5 do io <- 0 ; |
This construction is not compliant with the klexer4/kparser4. |
I extended the lexer and the parser in a branch. Would it be OK with you @hmedina ? |
It would be ok with my usage (assuming it's just adding some keywords to make the "update token Y to value X" statement less cryptic...) To elaborate, since the UI rejected that syntax, none of my big models use tokens & perturbations, because I did not know what a valid syntax would be. I only stumbled into working syntax when building a comprehensive KaTIE test, so changing the syntax will only cost me the time to re-write tests here and there. The maintainers for both Kappa manuals will need to update their respective works once the new syntax is defined. |
I have solved the conflict by restricting a little bit the grammar. a) the perturbation has a ending condition (repeat [ ]) b) or if it is in a list of perturbations bounded by some parentheses. Otherwise, it is not allowed. |
Since, the suggestion is strictly more expressive than what is in the master branch I merge. |
I'm not there anymore to do the maintenance so I don't have a voice but just to say: To remove all the |
@pirbo, you will keep a voice on the development of KappaTools forever and we deeply respect your legacy. This is why I would prefer to add the new notation. |
This raises an issue with the repeat clause being optional & defaulting to
The first statement is rejected; however I was under the impression it defaulted to the third statement. Should repeat clauses be always required? This would trigger issues like #643 |
Here what is accepted : Shall I authorize / require a semicolon after (io <- 0) ? |
%mod: [T] > 5 do io <- 0 ; // rejected |
How should multi-pertubation statements be constructed? In KaSimInBrowser (today's?), the following are rejected:
|
The way the grammar has been written, composite statements should be written as follows: |
Ok, so for documentation: someone should update table 2.7 of the official Kappa manual @plucky should update "Grammar 13: Intervention directives" in https://kappalanguage.org/sites/kappalanguage.org/files/inline-files/Kappa_Manual.pdf |
The UI static analyzer reports
1/1[model.ka] Incorrect beginning of sentence
, with a red squiggly under theio
in the firstmod
.Ignoring this message and hitting play produces the expected model behavior.
This syntax was referred by #607
The verbose version of the syntax is tested in https://github.com/Kappa-Dev/KappaTools/blob/master/tests/integration/compiler/tokens/tokens.ka
The text was updated successfully, but these errors were encountered: