Nick Fitzgerald
4c61c96c3f
Add Cargo.toml metadata
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
e23564700d
Add myself as a second author
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
bd8c7faf12
Add support for hex integer literals
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
8f5dffab72
Add better error messages for duplicate term declarations
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
22e18a9d98
Remove eprintln!s that shouldn't have been committed
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
037db8aab6
Make sure that infallible match operations come after fallible ones
...
Eventually we will probably want to sort by a partial ordering based on pattern
subsumption to break ties between rules with the same priority. This local
heuristic of making sure infallibilty comes last is good enough for now and
handles the cases we care about thus far.
Fixes #10
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
6c6b7a2b78
Add a method to pretty-print a trie
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
0411b20871
Fix allow declaration
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
7fab7c5eab
Emit if lets against Option<x> instead of Option<(x,)>
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
0c6956376b
Allow irrefutable let patterns in the generated code
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
e015a49270
Do not use 1-member tuples in external constructor/extractor trait methods
...
Just use the single member type directly.
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
0e02ec4cba
Use BTree{Map,Set} instead of Hash{Map,Set} to ensure deterministic output
...
Fixes #8
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
efe7df7f45
Keep track of where primitives are defined for better error messages
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
fe836a2302
Yield source positions from lexer that have file-relative offsets
...
They were previously all source texts concatenated-relative offsets, which would
cause `miette` to error out when trying to find the line/col when displaying
errors. Not good to have errors when displaying errors! Gets very confusing when
trying to track down ISLE type errors and things.
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
7f8cb75e54
Allow terms to have both extractors and constructors
...
Fixes #4
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
fddff6ee2d
Fix a panic when checking the call graph for an extractor with type errors in its definition
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
9af23bf061
Report the recursive calls when an extractor is recursive
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
31d1cf3808
Fill out implementation overview in README
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
381dadadd0
Move trie construction out to its own module
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
bffaccde1f
Add a tutorial to the README
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
0e082e8d6f
Make sure that every decl has a definition at the end of type checking
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
d2bd07c246
Check that integer literals are primitive types in patterns
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
ce207ee953
Check that integer literals are a primitive type
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
a099b2b590
Extend fuzzing to semantic analysis and codegen
...
* Fix a panic when we are substituting macro args, but we already had an error
involving the macro.
* Fix a stack overflow when an internal extractor's definition is recursive.
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
9be1942b11
Use .copied() instead of .cloned()
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
6604a26e27
Add a top-level parse function
...
And make `parse_defs` take `self` by ownership. This avoids a couple `Vec`
clones.
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
e3aeb850b2
Fix a panic when parsing var patterns
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
f2b6244b9c
Fix some panics on parsing error paths
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
6a523938de
Fix overflows when tokenizing integer literals
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
825258939b
Define a fuzz target for the parser
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
cfaa35d8c0
Use structopt to derive CLI flags
...
Instead of using `clap` directly
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
6ffb02d9f6
Use miette for reporting errors
...
This gives us errors with annotated context like this:
```
Error:
× type error: Unknown variable 'x'
╭─[isle_examples/let.isle:24:1]
24 │ (Lower (B.B z))
25 │ (A.Add x y))
· ┬
· ╰── Unknown variable 'x'
╰────
```
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
38da2cee3e
Switch to using thiserror
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
b93304b327
Add docs to all public exports and deny(missing_docs) going forward
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
922a3886d5
Fix let variable typing rules
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
972dc00a92
Don't use &mut dyn Write in codegen
...
We always use a `String` which has infallible writing so we can remove all these
`Result`s and pretend-fallible methods.
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
3535f82056
Remove an unused field in TermFunctionBuilder
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
012f4b04d7
Update TODO
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
5f5484ddbc
Use matches!(..) to make TrieNode::is_empty more concise
2021-11-11 15:56:55 -08:00
Nick Fitzgerald
66ba1d89b5
Remove TODO we don't want to do
...
If the extern types are represented with associated types, then we can't match
on them.
2021-11-11 15:56:55 -08:00
Chris Fallin
91904aa756
TODO items from call with fitzgen
2021-11-11 15:56:55 -08:00
Chris Fallin
20bc5ca7a8
Support extern constants of any primitive type.
2021-11-11 15:56:55 -08:00
Chris Fallin
d0ace640a2
TODO update.
2021-11-11 15:56:55 -08:00
Chris Fallin
521010cc4f
Split into isle and islec crates
2021-11-11 15:56:55 -08:00
Chris Fallin
e751f12ac5
Refactor to allow use as library, in order to allow build.rs usage.
2021-11-11 15:56:55 -08:00
Chris Fallin
83672a88cc
bugfix to macro template generation: exclude Pos on ident from equality (broken by recent commit)
2021-11-11 15:56:55 -08:00
Chris Fallin
3ed146b782
README update.
2021-11-11 15:56:55 -08:00
Chris Fallin
2a574b1b42
Properly track locations on every AST node. Semantic errors are much more useful now. Also print parse errors in same (pseudo-standard compiler error) output format.
2021-11-11 15:56:55 -08:00
Chris Fallin
7d38b3b6d8
Revamped error handling: keep going beyond some errors to accumulate a list of build errors, like most conventional compilers.
2021-11-11 15:56:55 -08:00
Chris Fallin
b46fa6acb0
Remove old/no longer used lower.rs
2021-11-11 15:56:55 -08:00