Repository navigation
s2: type decls and value args on types - #18
Merged
Merged
Conversation
Ast.Ty gains vals, the value args T(v, ...) (s1 order: name, [args], (vals), ^<caps>). Ast.TypeDecl (line, name, groups, value binders, body) with Ast.TBody = Alias(ty) | TyMatch(ty, arms) | ValMatch(binder, arms); value patterns are int, string, true, false or _ (Ast.VPat). The printer and the parser follow s1/parse.srs:297-346: a value binder followed by match is a value match, else a type optionally followed by match arms. Names declares a type decl as a type name and walks its types in its [] binders, with its value binders as locals of the value args (Names.tyIn). Printer functions that print types take a Region (value args are expressions). tests/s2/parse: value matches on an int and a Bool, a value arg with an expression, a type match, a type with evidence and facts groups, a param type with value args and caps print back as written; a type lambda is a parse error, as in s1. Parsing every source: 170 of 176; the rest are 4 s1 parse errors (s2 rejects them too), contracts.srs (clauses: next rung) and one int type arg (s1 rejects later).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FRONT rung 4b: type declarations and compile-time value args on types.
Ast.TygainsvalsforT(v, ...), in s1's order: name,[args],(vals),^<caps>.Ast.TypeDeclhas bodyAlias | TyMatch | ValMatch; value patterns are int, string, true, false, or_.Test: value matches on an int and a Bool, a value arg with an expression, a type match, a type with evidence and facts groups, and a param type with value args and caps all print back as written. A type lambda is a parse error, as in s1.
Parse probe: 170 of 176 sources. The other 6: four s1 parse errors (s2 rejects them too), contracts.srs (clauses, next rung), and one int type arg (s1 rejects it later). Local tests/run.sh: 185 ok, 0 FAIL.