Skip to content

Commit

Permalink
rename return to result in inet code
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Sep 18, 2023
1 parent f2ace2f commit 4f07e27
Show file tree
Hide file tree
Showing 33 changed files with 102 additions and 99 deletions.
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rename `return` to `result` in inet code
update readme -- for renaming from `return` to `result`
update docs -- for renaming from `return` to `result`
2 changes: 1 addition & 1 deletion tests/builtin/run-only-top-port.i.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ netFromPort (add1₂₅)-value!
(add1₂₅)-prev value-(add1₂₃)
(add1₂₃)-prev value-(zero₂₁)
end
netFromPort (add₁₀)-return
netFromPort (add₁₀)-result
(add₁₀)-target!value-(add1₂₂)
(add₁₀)-addend value-(add1₂₁)
(add1₂₂)-prev value-(zero₂₀)
Expand Down
6 changes: 3 additions & 3 deletions tests/builtin/spread.i
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ node add
Nat :target!
Nat :addend
--------
Nat :return
Nat :result
end

(add) @spread $target $addend $return
(add) @spread $target $addend $result
target @inspect
addend @inspect
return @inspect
result @inspect
2 changes: 1 addition & 1 deletion tests/builtin/spread.i.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
netFromPort (add₀)-target! end
netFromPort (add₀)-addend end
netFromPort (add₀)-return end
netFromPort (add₀)-result end
6 changes: 3 additions & 3 deletions tests/checking/connect-type.error.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ node add
Nat :target!
Nat :addend
--------
Nat :return
Nat :result
end

rule zero add
(add)-addend
(add)-return sole @connect
(add)-result sole @connect
end

rule add1 add
(add)-addend (add1)-prev add add1
return-(add)
result-(add)
end
6 changes: 3 additions & 3 deletions tests/checking/connect-type.error.i.err
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
14 |
15 |rule zero add
16 | (add)-addend
17 | (add)-return sole @connect
17 | (add)-result sole @connect
18 |end
19 |

Expand All @@ -19,12 +19,12 @@
rule nodes: zero add

11 | --------
12 | Nat :return
12 | Nat :result
13 |end
14 |
15 |rule zero add
16 | (add)-addend
17 | (add)-return sole @connect
17 | (add)-result sole @connect
18 |end
19 |
20 |rule add1 add
6 changes: 3 additions & 3 deletions tests/checking/locals-not-used-in-rule.error.i
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ node add
Nat :target!
Nat :addend
--------
Nat :return
Nat :result
end

rule zero add
(add)-addend
return-(add)
result-(add)
end

rule add1 add
Expand All @@ -29,5 +29,5 @@ rule add1 add

'abc $abc

add1 return-(add)
add1 result-(add)
end
4 changes: 2 additions & 2 deletions tests/checking/locals-not-used-in-rule.error.i.err
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
rule nodes: add1 add

22 | (add)-addend
23 | return-(add)
23 | result-(add)
24 |end
25 |
26 |rule add1 add
Expand All @@ -16,6 +16,6 @@
29 |
30 | 'abc $abc
31 |
32 | add1 return-(add)
32 | add1 result-(add)
33 |end
34 |
6 changes: 3 additions & 3 deletions tests/checking/rule-node-order.error.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ node add
Nat :target!
Nat :addend
--------
Nat :return
Nat :result
end

rule add zero
(add)-addend
(add)-return sole @connect
(add)-result sole @connect
end

// The correct definition is:

// rule zero add
// (add)-addend
// (add)-return sole @connect
// (add)-result sole @connect
// end
4 changes: 2 additions & 2 deletions tests/checking/rule-node-order.error.i.err
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
rule nodes: add zero

11 | --------
12 | Nat :return
12 | Nat :result
13 |end
14 |
15 |rule add zero
16 | (add)-addend
17 | (add)-return sole @connect
17 | (add)-result sole @connect
18 |end
19 |
20 |// The correct definition is:
8 changes: 4 additions & 4 deletions tests/checking/rule-sign.error.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ node add
Nat :target!
Nat :addend
--------
Nat :return
Nat :result
end

rule zero add
(add)-addend
return-(add)
result-(add)
end

rule add1 add
(add)-addend prev-(add1) add add1
return-(add)
result-(add)
end

// The correct definition is:

// rule add1 add
// (add)-addend (add1)-prev add add1
// return-(add)
// result-(add)
// end
6 changes: 3 additions & 3 deletions tests/checking/rule-sign.error.i.err
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
19 |
20 |rule add1 add
21 | (add)-addend prev-(add1) add add1
22 | return-(add)
22 | result-(add)
23 |end

[DefineRule.execute] I fail to define rule.

rule nodes: add1 add

16 | (add)-addend
17 | return-(add)
17 | result-(add)
18 |end
19 |
20 |rule add1 add
21 | (add)-addend prev-(add1) add add1
22 | return-(add)
22 | result-(add)
23 |end
24 |
25 |// The correct definition is:
8 changes: 4 additions & 4 deletions tests/checking/rule-type-occur-check.error.i
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ node append
'A List :target!
'A List :rest
--------
'A List :return
'A List :result
end
rule null append
(append)-rest
return-(append)
result-(append)
end
rule cons append
(cons)-head
(append)-rest (cons)-tail append
cons
return-(append)
result-(append)
end
// The correct definition is:
// rule cons append
// (append)-rest (cons)-tail append
// (cons)-head cons
// return-(append)
// result-(append)
// end
6 changes: 3 additions & 3 deletions tests/checking/rule-type-occur-check.error.i.err
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
28 | (cons)-head
29 | (append)-rest (cons)-tail append
30 | cons
31 | return-(append)
31 | result-(append)
32 |end

[DefineRule.execute] I fail to define rule.

rule nodes: cons append

23 | (append)-rest
24 | return-(append)
24 | result-(append)
25 |end
26 |
27 |rule cons append
28 | (cons)-head
29 | (append)-rest (cons)-tail append
30 | cons
31 | return-(append)
31 | result-(append)
32 |end
33 |
34 |// The correct definition is:
6 changes: 3 additions & 3 deletions tests/checking/rule-type.error.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ node add
Nat :target!
Nat :addend
--------
Nat :return
Nat :result
end

rule zero add
(add)-addend
return-(add)
result-(add)
end

rule add1 add
(add)-addend (add1)-prev add sole add1
return-(add)
result-(add)
end
6 changes: 3 additions & 3 deletions tests/checking/rule-type.error.i.err
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
19 |
20 |rule add1 add
21 | (add)-addend (add1)-prev add sole add1
22 | return-(add)
22 | result-(add)
23 |end

[DefineRule.execute] I fail to define rule.

rule nodes: add1 add

16 | (add)-addend
17 | return-(add)
17 | result-(add)
18 |end
19 |
20 |rule add1 add
21 | (add)-addend (add1)-prev add sole add1
22 | return-(add)
22 | result-(add)
23 |end
24 |
6 changes: 3 additions & 3 deletions tests/datatype/Bin.i
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ from "./Nat.i"
node natDouble
Nat :target!
------------
Nat :return
Nat :result
end

rule zero natDouble
zero return-(natDouble)
zero result-(natDouble)
end

rule add1 natDouble
(add1)-prev natDouble add1 add1 return-(natDouble)
(add1)-prev natDouble add1 add1 result-(natDouble)
end

node ntob
Expand Down
8 changes: 4 additions & 4 deletions tests/datatype/DiffList.i
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ node diffAppend
'A DiffList :target!
'A DiffList :rest
--------
'A DiffList :return
'A DiffList :result
end

node diffOpen
'A DiffList :target!
'A List :list
----------
'A List :return
'A List :result
end
rule diff diffAppend
(diff)-front diff return-(diffAppend)
(diff)-front diff result-(diffAppend)
(diffAppend)-rest diffOpen back-(diff)
end
rule diff diffOpen
(diff)-back list-(diffOpen)
(diff)-front return-(diffOpen)
(diff)-front result-(diffOpen)
end
4 changes: 2 additions & 2 deletions tests/datatype/DiffList.test.i.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
netFromPort (diffAppend₂)-return
netFromPort (diffAppend₂)-result
(diffAppend₂)-target!value-(diff₆)
(diffAppend₂)-rest value-(diff₅)
(diff₆)-front value-(cons₇)
Expand All @@ -19,7 +19,7 @@ netFromPort (diff₇)-value!
(cons₆)-tail value-(cons₅)
(cons₅)-head value-(sole₃)
end
netFromPort (diffAppend₄)-return
netFromPort (diffAppend₄)-result
(diffAppend₄)-target!value-(diff₁₁)
(diffAppend₄)-rest value-(diff₁₀)
(diff₁₁)-front value-(cons₁₅)
Expand Down
6 changes: 3 additions & 3 deletions tests/datatype/List.i
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ node append
'A List :target!
'A List :rest
--------
'A List :return
'A List :result
end

rule null append
(append)-rest
return-(append)
result-(append)
end

rule cons append
(append)-rest (cons)-tail append
(cons)-head cons
return-(append)
result-(append)
end
2 changes: 1 addition & 1 deletion tests/datatype/List.test.i.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
netFromPort (append₄)-return
netFromPort (append₄)-result
(append₄)-target!value-(cons₁₃)
(append₄)-rest value-(cons₁₀)
(cons₁₃)-head value-(sole₁₁)
Expand Down
Loading

0 comments on commit 4f07e27

Please sign in to comment.