Brian Huffman
2e72a7387c
Replace fromIntegral
with fromInteger
or toInteger
where possible.
...
See #637 .
2019-07-24 13:13:11 -07:00
Brian Huffman
484f9fc631
Fix typos in comments.
2019-07-24 13:10:34 -07:00
Iavor Diatchki
ce26749142
Flush after storing, so that we can see the content.
2019-07-05 14:52:13 -07:00
Iavor Diatchki
8fe9f5efa9
Add support for working with in-memory sources.
...
Currently we only use this for the Prelude, which is baked into Cryptol.
Previously we used to save it in a temporary file, which would show
up in error messages, leading to bad user experience and unreliable
test outputs.
Also improves the shadowing errors.
Fixes #569
2019-07-05 14:09:04 -07:00
Iavor S. Diatchki
cc5c10b4c4
Merge pull request #630 from GaloisInc/prelude_prims
...
Prelude Prims
2019-07-05 09:57:58 -07:00
Iavor Diatchki
ca4968ff3d
Fix test. The error message changed, but is still valid.
...
We should really have only one way to say this,
I made a ticket: #633
2019-07-05 09:37:45 -07:00
Iavor Diatchki
4b5d569e09
Fix tests---some variables got renumbered.
...
We really should fix this up so we don't print the numbers unless
there really is an ambiguity.
2019-07-05 09:34:20 -07:00
Iavor Diatchki
91b69e85cd
Remove debugging output.
2019-07-05 09:31:44 -07:00
Iavor Diatchki
7c708faa47
Show additional type constraints in help message.
2019-07-05 09:16:53 -07:00
Iavor Diatchki
a0b4b14f86
Make constraints on type constructors/functions explicit.
...
This is mostly working, but I still need to update the help on the REPL
to show the constraints.
2019-07-03 17:03:31 -07:00
Iavor Diatchki
971897d9ca
Use 'Prop' instead of '@' to write the kind of a constraint.
...
This is more consistent with how we've been printing kinds for a while,
so no need to change the notation.
2019-07-03 10:21:04 -07:00
Iavor Diatchki
72068cb961
Move type-level primitives to the Prelude.
...
For the time being, there is still some information about them that
is duplicated in Cryptol.TypeCheck.TCon, but we at least the parsed syntax
does not depend on the typechecked syntax.
2019-07-02 17:34:36 -07:00
Iavor Diatchki
1cfadef5ea
Add a forgotten test
2019-07-01 10:26:39 -07:00
brianhuffman
c5dec7443a
Merge pull request #628 from GaloisInc/issue625
...
Issue625
2019-06-28 11:31:28 -07:00
Brian Huffman
8b0e236eec
Support element type ascriptions on list enumerations: [a,b..c:t]
.
...
Cf. issue #625 .
2019-06-27 14:31:06 -07:00
Brian Huffman
e03446dbc8
Adjust whitespace.
2019-06-27 14:25:08 -07:00
Brian Huffman
1e11ff6b8b
Add type constraint synonyms (<) and (>).
...
Fixes #400 .
2019-06-26 20:44:13 -07:00
brianhuffman
c071ff9fa4
Merge pull request #627 from GaloisInc/infix-type
...
Infix type synonyms
2019-06-26 20:06:54 -07:00
Brian Huffman
14d25e8f9a
Fix pretty printing for infix type/constraint synonyms.
2019-06-26 18:19:12 -07:00
Brian Huffman
10da255fd1
Re-implement infix type constraint (<=) as a constraint synonym.
...
Also removed special-case hack for (<=) in the renamer.
Also adapted test case output to account for the new prelude declaration.
2019-06-26 18:04:16 -07:00
Brian Huffman
17c47c4ac0
Update type pretty-printer to handle infix type synonyms.
2019-06-26 17:54:40 -07:00
Brian Huffman
fb86b1538c
Renamer looks up type operator fixities in the NamingEnv.
...
Primitive infix type operators are looked up in a hard-coded
table; everything else is looked up in the NamingEnv.
2019-06-26 17:36:46 -07:00
Brian Huffman
eadaf4473e
Add parser rules for infix type/constraint synonyms.
2019-06-26 17:35:19 -07:00
Brian Huffman
b54e4835ac
Make kind checker accept TInfix constructors from the renamer.
2019-06-26 17:29:55 -07:00
Brian Huffman
da1c509ffd
Propagate fixities from type declarations into the NamingEnv.
2019-06-26 16:54:40 -07:00
Brian Huffman
019d2af088
NoPat pass annotates type/constraint synonyms with fixities.
2019-06-26 15:20:00 -07:00
Brian Huffman
c0914c96df
Add fixity field to TySyn and PropSyn datatypes.
2019-06-26 15:13:37 -07:00
Brian Huffman
0f6e627b52
Fix typos in haddock comments.
2019-06-26 13:29:07 -07:00
Brian Huffman
546d7809e9
Remove fixity table from NamingEnv.
...
The Name type already contains fixity information we can use.
2019-06-26 13:17:13 -07:00
Brian Huffman
d3bc9baa43
Fix typo in haddock comment.
2019-06-26 12:59:41 -07:00
brianhuffman
44a617693b
Merge pull request #626 from GaloisInc/simplify-parser
...
Simplify parser
2019-06-25 17:11:58 -07:00
Brian Huffman
a8552f58a6
Remove duplicated code for parsing/renaming/checking constraints.
...
We now re-use the same code that is used to parse, rename, and
kind-check type expressions.
2019-06-25 14:26:40 -07:00
Brian Huffman
f53c1f8777
Disambiguate Parser.y so we don't need to rely on operator precedences.
2019-06-25 09:54:23 -07:00
Brian Huffman
5b912afe5a
Fix typo in comment.
2019-06-24 13:18:41 -07:00
Brian Huffman
eb7b74a041
Improved formatting for fixity error message.
...
Cf. #590 .
2019-06-24 11:43:08 -07:00
Brian Huffman
f0e527a9dc
More informative, nicer error message for fixity errors.
...
Fixes #590 .
2019-06-21 16:01:17 -07:00
Brian Huffman
8001e5d09c
Fix typo in comment.
2019-06-21 11:58:21 -07:00
Brian Huffman
5d19320bfa
Regenerate pdf of Programming Cryptol book.
2019-06-20 11:07:36 -07:00
Brian Huffman
c62a88a8ec
Regenerate Syntax.tex from Syntax.md.
2019-06-20 11:07:18 -07:00
Brian Huffman
bf2a235c1c
Regenerate ProgrammingCryptol.pdf.
2019-06-20 11:03:14 -07:00
Brian Huffman
7da982ab2d
Update old cryptol-1 syntax in example code.
2019-06-20 10:54:06 -07:00
Brian Huffman
030349f6de
Fix outdated usage of value-level function width
in Cryptol book.
...
It is now called `length` and has a generalized type.
Cf. #549 .
2019-06-20 10:47:40 -07:00
brianhuffman
641f6563c4
Merge pull request #609 from GaloisInc/lhs-indexing
...
Lhs indexing
2019-06-19 13:03:42 -07:00
Brian Huffman
00eaa3c187
Factor out function from duplicated code in parser.
2019-06-19 11:34:02 -07:00
Brian Huffman
b83d887551
Update generated Syntax.pdf.
2019-06-19 11:25:46 -07:00
Brian Huffman
8d2f1ed2ba
Add examples of x @ i = e
syntax to Syntax.md.
2019-06-19 11:25:30 -07:00
Brian Huffman
088126076e
Remove trailing whitespace.
2019-06-19 11:24:59 -07:00
Brian Huffman
829c9b9494
Support lhs indexing on record field constructors and updaters.
...
For example, we can now write
foo = { f : [8] -> [4][4][8] }
foo = { f i @ j @ k = i + j + k }
2019-06-19 10:30:28 -07:00
Brian Huffman
4e8ec4f8d0
Fix pretty printer precedences for type expressions to match grammar.
...
Fixes #610 .
2019-06-18 17:57:18 -07:00
Brian Huffman
d94a37adea
Add parser fixity declaration for '@' to avoid shift/reduce conflict.
2019-06-18 17:10:46 -07:00