-
Notifications
You must be signed in to change notification settings - Fork 198
Param #833
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
Param #833
Changes from 5 commits
eab73f9
9569bdc
c9c6edb
84af71c
2dccc50
30d29a5
66dbd9c
5ec8d05
90ddad1
ba34366
068fc60
8e33dc1
cb6b14b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "Ext/libhandler"] | ||
path = Ext/libhandler | ||
url = https://github.com/koka-lang/libhandler.git |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,10 +60,10 @@ topDecl : typeDefDecl | |
| namedModuleDecl | ||
| testDecl | ||
| implementationDecl | ||
| globalValDecl | ||
| globalParamDecl | ||
; | ||
|
||
globalValDecl : CONSTANT idenList COLON type SEMI ; | ||
globalParamDecl : PARAM idenList COLON type SEMI ; | ||
|
||
typeDefDecl : TYPE name=iden SEMI # ForeignTypeDef | ||
| TYPE name=iden ASSIGN type SEMI # PTypeDef | ||
|
@@ -255,6 +255,7 @@ param : LPAREN paramBody RPAREN; | |
|
||
testDecl : TEST testName=iden (LBRACK MAIN ASSIGN mainMachine=iden RBRACK) COLON modExpr SEMI # SafetyTestDecl | ||
| PARAMTEST globalParam=param testName=iden (LBRACK MAIN ASSIGN mainMachine=iden RBRACK) COLON modExpr SEMI # ParametricSafetyTestDecl | ||
| PARAMTEST globalParam=param ASSUME assumeExpr=expr testName=iden (LBRACK MAIN ASSIGN mainMachine=iden RBRACK) COLON modExpr SEMI # ParametricAssumeSafetyTestDecl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add another rule or can we also merge the two param test kinds making the assume optional? |
||
| TEST testName=iden (LBRACK MAIN ASSIGN mainMachine=iden RBRACK) COLON modExpr REFINES modExpr SEMI # RefinementTestDecl | ||
; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
using Antlr4.Runtime; | ||
using System.Collections.Generic; | ||
|
||
public enum TestKind { | ||
NormalTest, | ||
ParametricTest, | ||
AssumeParametricTest, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we merge the Parametric and AssumeParametric Tests? |
||
} | ||
|
||
namespace Plang.Compiler.TypeChecker.AST.Declarations | ||
{ | ||
public class SafetyTest : IPDecl | ||
|
@@ -15,6 +21,8 @@ public SafetyTest(ParserRuleContext sourceNode, string testName) | |
public IPModuleExpr ModExpr { get; set; } | ||
|
||
public IDictionary<string, List<IPExpr>> ParamExpr { get; set; } | ||
public IPExpr AssumeExpr { get; set; } | ||
public TestKind TestKind { get; set; } | ||
public string Name { get; } | ||
public ParserRuleContext SourceLocation { get; } | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we adding these back? Can we remove all these unrelated changes?