Skip to content
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

Add support for Promela #5659

Merged
merged 6 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,9 @@
[submodule "vendor/grammars/sublime-pony"]
path = vendor/grammars/sublime-pony
url = https://github.com/CausalityLtd/sublime-pony
[submodule "vendor/grammars/sublime-promela-spin"]
path = vendor/grammars/sublime-promela-spin
url = https://github.com/corbanmailloux/sublime-promela-spin.git
[submodule "vendor/grammars/sublime-q"]
path = vendor/grammars/sublime-q
url = https://github.com/komsit37/sublime-q
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,8 @@ vendor/grammars/sublime-opal:
- source.opalsysdefs
vendor/grammars/sublime-pony:
- source.pony
vendor/grammars/sublime-promela-spin:
- source.promela
vendor/grammars/sublime-q:
- source.q
- source.q_output
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4633,6 +4633,14 @@ Prolog:
tm_scope: source.prolog
ace_mode: prolog
language_id: 295
Promela:
type: programming
color: "#de0000"
tm_scope: source.promela
ace_mode: text
extensions:
- ".pml"
language_id: 441858312
Propeller Spin:
type: programming
color: "#7fa2a7"
Expand Down
44 changes: 44 additions & 0 deletions samples/Promela/Session.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "Supervisor.pml"
/* Supervisor.pml includes Thread.pml (which includes Invariants.prp) */

init
{
byte i = 0;
assert_all(i, 0, 0);
sv_ctor(i);
i = 0;
assert_all(i, READY, CONTINUE);
printf("Init starts Supervisor...\n");
sv_start_sync();
do
:: if
:: get_state(0) == RUNNING ->
printf("Init pauses Supervisor...\n");
if
:: true -> pause(0, true)
:: true -> pause(0, false)
fi
:: get_state(0) == PAUSED ->
printf("Init resumes Supervisor...\n");
if
:: true -> resume(0, true)
:: true -> resume(0, false)
fi
:: true -> skip
fi
:: break
od
if
:: printf("Init stops Supervisor...\n");
if
:: true -> stop(0, true)
:: true -> stop(0, false)
fi
:: true -> skip
fi
wait_for_HALT_mask(0);
i = 0;
sv_dtor(i);
i = 0;
assert_all(i, 0, 0)
}
Loading