Repository navigation
s2: trait and given (Ast, printer, parser, names) - #16
Merged
Merged
Conversation
… check
Ast.Trait(line, name, groups, sigs) and Ast.Given(line, groups, head, fns) are new declarations
(Ast.DTrait, Ast.DGiven). The printer writes a trait method as a def without extern (Ast.fnSig, shared
with Ast.fn). The parser reads trait Name groups: with signatures and given groups Head[args]: with
defs; handler fns use the same Parse.defs. Names declares a trait as a type name and checks the types of
its signatures and of a given head and its methods in their [] binders.
tests/s2/parse: a trait with three [] binders, a given with a qualified head, a given with [] and {}
groups print back as written. Parsing every source: 132 of 176 parse (was 108); the rest are type
decls, spec def, int and value type args, and two genuine parse errors.
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 3: trait and given.
Ast.Trait(line, name, groups, sigs)andAst.Given(line, groups, head, fns).extern(Ast.fnSig, shared withAst.fn).Parse.defs.[]binders.Test: a trait with three
[]binders, a given with a qualified head, and a given with[]and{}groups each print back exactly as written. Parse probe over all sources: 132 of 176 parse (was 108); the rest are type decls, spec def, int and value type args, and two genuine parse errors. Local tests/run.sh: 185 ok, 0 FAIL.