Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/PPublic

Commitd3c3eda

Browse files
[PVerifier] exception handling for PVerifier-specific tokens (#906)
* [tweak] exception handling for PVerifier-specific tokens* save* fix Raft pproj config---------Co-authored-by: Ankush Desai <ankushdesai@users.noreply.github.com>
1 parentdff7bae commitd3c3eda

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

‎Src/PCompiler/CompilerCore/Compiler.cs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public int Compile(ICompilerConfiguration job)
3434
Environment.ExitCode=1;
3535
returnEnvironment.ExitCode;
3636
}
37+
catch(NotSupportedExceptione)
38+
{
39+
job.Output.WriteError("[NotSupportedError:]\n"+e.Message);
40+
Environment.ExitCode=1;
41+
returnEnvironment.ExitCode;
42+
}
3743

3844
job.Output.WriteInfo("Type checking ...");
3945
// Run type checker and produce AST
@@ -163,7 +169,7 @@ private static PParser.ProgramContext Parse(ICompilerConfiguration job, FileInfo
163169
casePParser.INIT:
164170
casePParser.PURE:
165171
thrownewNotSupportedException(
166-
$"line{token.Line}:{token.Column}\"{token.Text}\" only supported by PVerifier backend.");
172+
$"{inputFile.FullName} (line{token.Line}:{token.Column}):\"{token.Text}\" keyword is only supported by PVerifier backend.");
167173
}
168174
}
169175

‎Tutorial/5_Paxos/PSpec/common.p‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
// Unreliably send event `e` with payload `p` to every `target`
2-
funUnreliableBroadcast(targets:set[machine],e:event,payload:any) {
2+
funUnreliableBroadcast(target_machines:set[machine],e:event,payload:any) {
33
vari:int;
4-
while (i< sizeof(targets)) {
4+
while (i< sizeof(target_machines)) {
55
if (choose()) {
6-
sendtargets[i],e, payload;
6+
sendtarget_machines[i],e, payload;
77
}
88
i=i+1;
99
}
1010
}
1111

1212
// Unreliably send event `e` with payload `p` to every `target`, potentially multiple times
13-
fun UnreliableBroadcastMulti(targets:set[machine],e:event,payload:any) {
13+
fun UnreliableBroadcastMulti(target_machines:set[machine],e:event,payload:any) {
1414
vari: int;
1515
varn: int;
1616
vark: int;
1717

18-
while (i<sizeof(targets)) {
18+
while (i<sizeof(target_machines)) {
1919
//Eachmessageissent `k`isthatnumberoftimes
2020
k =choose(3);
2121
//Timeswe'vesentthepacketsofar
2222
n =0;
2323
while (n<k) {
24-
sendtargets[i],e,payload;
24+
sendtarget_machines[i],e,payload;
2525
n =n +1;
2626
}
2727
i =i +1;
2828
}
2929
}
3030

3131
//Reliablysendevent `e`withpayload `p`toevery `target`
32-
funReliableBroadcast(targets:set[machine],e:event,payload:any) {
32+
funReliableBroadcast(target_machines:set[machine],e:event,payload:any) {
3333
vari:int;
34-
while (i<sizeof(targets)) {
35-
sendtargets[i],e,payload;
34+
while (i<sizeof(target_machines)) {
35+
sendtarget_machines[i],e,payload;
3636
i =i +1;
3737
}
3838
}
3939

4040
//Reliablysendevent `e`withpayload `p`toamajorityof `target`.Unreliablesendtoremaining,potentiallymultipletimes.
41-
funReliableBroadcastMajority(targets:set[machine],e:event,payload:any) {
41+
funReliableBroadcastMajority(target_machines:set[machine],e:event,payload:any) {
4242
vari:int;
4343
varn:int;
4444
vark:int;
4545
varmajority:int;
4646

47-
majority =sizeof(targets) /2 +1;
47+
majority =sizeof(target_machines) /2 +1;
4848

49-
while (i<sizeof(targets)) {
49+
while (i<sizeof(target_machines)) {
5050
//Eachmessageissent `k`isthatnumberoftimes
5151
k =1;
5252
if (i >=majority) {
@@ -55,7 +55,7 @@ fun ReliableBroadcastMajority(targets: set[machine], e: event, payload: any) {
5555
//Timeswe'vesentthepacketsofar
5656
n =0;
5757
while (n<k) {
58-
sendtargets[i],e,payload;
58+
sendtarget_machines[i],e,payload;
5959
n =n +1;
6060
}
6161
i =i +1;

‎Tutorial/6_Raft/Raft.pproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<PFile>./PTst/</PFile>
77
</InputFiles>
88
<OutputDir>./PGenerated/</OutputDir>
9-
<Target>CSharp</Target>
9+
<Target>PChecker</Target>
1010
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp