Geoff Romer
93842ad878
Eliminate run-time errors from PatternMatch ( #1126 )
2022-03-10 16:46:43 -08:00
pk19604014
2ea7de8a17
Fixed a couple crashes surfaced by running a structured fuzzer on executable_semantics parse/type-check/execute logic. ( #1106 )
...
* Fixed a couple simple crashes surfaced by running a structured fuzzer on executable_semantics parse/type-check/execute logic.
* var a: b: auto; -> var a: auto;
2022-03-04 14:45:50 -05:00
Richard Smith
8c60ad2e19
Implement the current set of rules for precedence partial ordering ( #1096 )
...
In the process, switch to an unambiguous grammar, using the
precedence-climbing method for operator precedence (suitably modified to
handle a partial precedence order) rather than Bison %precedence /
%prec.
2022-03-03 13:36:35 -08:00
7cce1bd124
interfaces, impls, and constrained generics (basics) ( #1073 )
...
* interfaces, impls, and constrained generics (basics)
* separate type checking into declare vs. type check, removing redundancy
* external impls
* added impl scopes to handle generics calling generics
* cleanup
* more cleanup
* Update executable_semantics/testdata/interface/external_impl_point_vector.carbon
Co-authored-by: josh11b <josh11b@users.noreply.github.com >
* Update executable_semantics/testdata/interface/generic_call_generic.carbon
Co-authored-by: josh11b <josh11b@users.noreply.github.com >
* Update executable_semantics/testdata/interface/tuple_vector_add_scale.carbon
Co-authored-by: josh11b <josh11b@users.noreply.github.com >
* Update executable_semantics/testdata/interface/vector_point_add_scale.carbon
Co-authored-by: josh11b <josh11b@users.noreply.github.com >
* change ImplementationDeclaration to ImplDeclaration
* remove impl_type_value
* split NamedEntity into two
* changed GetName to be a free function
* adding comments
* more edits to respond to review
* introduce ImplBinding, remove punning on GenericBinding
* new test case and some minor edits
* refactor GetMember and GetField to move impl logic to interpreter
* remove commennt
* change EntityView to ImplBinding in FieldAccess...
* move ImplBinding
* review response
* added example to impl_scope.h
* minor edits
* Update executable_semantics/interpreter/field_path.h
Co-authored-by: Geoff Romer <gromer@google.com >
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Geoff Romer <gromer@google.com >
* Update executable_semantics/interpreter/interpreter.cpp
Co-authored-by: Geoff Romer <gromer@google.com >
* Update executable_semantics/ast/expression.h
Co-authored-by: Geoff Romer <gromer@google.com >
* Update executable_semantics/ast/expression.h
Co-authored-by: Geoff Romer <gromer@google.com >
* Update executable_semantics/ast/generic_binding.h
Co-authored-by: Geoff Romer <gromer@google.com >
* more edits from review
* review response
* Update executable_semantics/ast/static_scope.h
Co-authored-by: Geoff Romer <gromer@google.com >
* remove ImplType, renamed node_view to value_node
Co-authored-by: josh11b <josh11b@users.noreply.github.com >
Co-authored-by: Geoff Romer <gromer@google.com >
2022-03-02 15:58:45 -05:00
Jon Meow
7dcb7a3be8
Drop line because it's a set so arbitrary sorting applies ( #1043 )
2022-01-26 15:13:26 -08:00
Geoff Romer
461e178273
Store named constant values in the AST ( #1011 )
...
This enables us to stop using `Env` in the typechecker. As a byproduct, this commit also restructures the interpreter to handle run-time global initialization as part of ordinary execution, using the Action stack.
2022-01-13 11:07:28 -08:00
Geoff Romer
c89ce1d570
Handle identifier value category properly. ( #986 )
2021-12-15 13:27:36 -08:00
Geoff Romer
daf8729a75
Use static names in typechecker. ( #985 )
2021-12-14 11:26:53 -08:00
Jon Meow
beea60d0b8
Switch prelude to a file and refactor lit testing to pass commands directly. ( #966 )
2021-12-03 14:23:13 -08:00
Jon Meow
3c76b0ab01
Test --trace directly ( #933 )
2021-12-02 13:54:35 -08:00
Geoff Romer
be0c1e9da6
Move value-category checking to compile time ( #960 )
2021-11-29 17:07:50 -08:00
Jon Meow
6d822ababb
Rename main to Main for Carbon style consistency ( #939 )
...
Main() is more consistency with Carbon's naming guidelines. C# offers some precedent: https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/main-command-line
2021-11-02 14:53:18 -07:00
Geoff Romer
bb28d37eed
Drop support for named tuple fields ( #886 )
...
Rationale: Based on the status of #478 and #505 , Carbon won't have this feature for a while, and it will be simpler not to support it on spec in the meantime.
2021-10-15 13:19:57 -07:00
Jon Meow
395a331cde
Reorganize tests into dirs and rename numbered tests ( #825 )
...
There's a small update to update_checks.py to handle the recursive directories. Also, I'm only using one level of nesting in this PR but really no reason we can't do more. I'm just not sure what clustering is best right now.
As a pattern, I'm trying to name all failing tests `fail_*.carbon`.
2021-09-15 16:37:34 -07:00