-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
11 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
k-distribution/tests/regression-new/checks/checkNoSymbolOverload.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module CHECKNOSYMBOLOVERLOAD-SYNTAX | ||
endmodule | ||
|
||
module CHECKNOSYMBOLOVERLOAD | ||
syntax LVal | ||
syntax RVal | ||
syntax Val ::= LVal | RVal | ||
syntax Exp ::= Val | ||
|
||
syntax RVals ::= RVal [overload(arg)] | ||
syntax Vals ::= Val [overload(arg), symbol(val)] | ||
syntax Exps ::= Exp [overload(arg)] | ||
endmodule |
11 changes: 11 additions & 0 deletions
11
k-distribution/tests/regression-new/checks/checkNoSymbolOverload.k.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Error] Compiler: Production would not be a KORE symbol and therefore cannot be overloaded. Add a `symbol(_)` attribute to the production. | ||
Source(checkNoSymbolOverload.k) | ||
Location(10,20,10,40) | ||
10 | syntax RVals ::= RVal [overload(arg)] | ||
. ^~~~~~~~~~~~~~~~~~~~ | ||
[Error] Compiler: Production would not be a KORE symbol and therefore cannot be overloaded. Add a `symbol(_)` attribute to the production. | ||
Source(checkNoSymbolOverload.k) | ||
Location(12,20,12,40) | ||
12 | syntax Exps ::= Exp [overload(arg)] | ||
. ^~~~~~~~~~~~~~~~~~~~ | ||
[Error] Compiler: Had 2 structural errors. |
6 changes: 6 additions & 0 deletions
6
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DEF=test | ||
EXT=test | ||
TESTDIR=. | ||
KOMPILE_FLAGS=--syntax-module TEST | ||
|
||
include ../../../include/kframework/ktest.mak |
1 change: 1 addition & 0 deletions
1
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/exps.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rv(0), rv(1), rv(2), (1, 2) |
3 changes: 3 additions & 0 deletions
3
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/exps.test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<k> | ||
exps ~> .K | ||
</k> |
1 change: 1 addition & 0 deletions
1
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/rvals.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rv(0), rv(1), rv(2) |
3 changes: 3 additions & 0 deletions
3
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/rvals.test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<k> | ||
rvals ~> .K | ||
</k> |
39 changes: 39 additions & 0 deletions
39
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/test.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module TEST | ||
imports DOMAINS | ||
|
||
syntax LVal ::= lv(Int) | lv(Id) | ||
syntax RVal ::= rv(Int) | ||
syntax Val ::= LVal | RVal | ||
|
||
syntax Exp ::= Int | ||
| Id | ||
| Val | ||
| "(" Exp ")" [bracket] | ||
> left: | ||
Exp "," Exp [group(comma)] | ||
|
||
syntax RVals ::= RVal [overload(arg), group(assignExp), symbol(rval), avoid] | ||
| RVals "," RVal [overload(exps), group(assignExp)] | ||
|
||
syntax Vals ::= Val [overload(arg), group(assignExp), symbol(val), avoid] | ||
| Vals "," Val [overload(exps), group(assignExp)] | ||
|
||
syntax Exps ::= Exp [overload(arg), group(assignExp), symbol(exp), avoid] | ||
| Exps "," Exp [overload(exps), group(assignExp)] | ||
|
||
syntax Exps ::= Vals | ||
syntax Vals ::= RVals | ||
|
||
syntax priority assignExp > comma | ||
|
||
syntax KItem ::= "rvals" | ||
| "vals" | ||
| "exps" | ||
|
||
configuration | ||
<k> $PGM:Exps </k> | ||
|
||
rule _:RVals => rvals | ||
rule _:Vals => vals | ||
rule _:Exps => exps [owise] | ||
endmodule |
1 change: 1 addition & 0 deletions
1
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/vals.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rv(0), lv(x), rv(2) |
3 changes: 3 additions & 0 deletions
3
k-distribution/tests/regression-new/issue-4142-no-symbol-overload/vals.test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<k> | ||
vals ~> .K | ||
</k> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters