Commit Graph

33578 Commits

Author SHA1 Message Date
Asumu Takikawa
6ce16e1538 Factor out class expansion parsing
This commit prepares the code for more interesting parsing
of the initializer body (for expansion-introduced top-level
expressions for example) and faster parsing of methods and
other things in a single pass.
2014-02-20 16:50:23 -05:00
Asumu Takikawa
599beeae52 Fix non-expected case with inits/fields missing annotations
Also fix bogus test cases and the bug that hid them
2014-02-20 16:50:23 -05:00
Asumu Takikawa
f188d7f103 Check more clause presence/absence appropriately 2014-02-20 16:50:22 -05:00
Asumu Takikawa
f010a9ce71 Rule out multiple super-new 2014-02-20 16:50:22 -05:00
Asumu Takikawa
0ef255916d Add support for private methods 2014-02-20 16:50:22 -05:00
Asumu Takikawa
ab8513f48d Fix bug that triggers due to missing super-new 2014-02-20 16:50:22 -05:00
Asumu Takikawa
c009948627 Make sure super inits that are provided don't count 2014-02-20 16:50:22 -05:00
Asumu Takikawa
b1627984e2 Make sure superclass mandatory inits are provided 2014-02-20 16:50:22 -05:00
Asumu Takikawa
c16a3b2350 Fix inheritance without expected type 2014-02-20 16:50:22 -05:00
Asumu Takikawa
d8a3039830 Set init arguments as optional correctly 2014-02-20 16:50:22 -05:00
Asumu Takikawa
f895e3156f Make internal/external names work 2014-02-20 16:50:22 -05:00
Asumu Takikawa
ae2866e8ca Better class types when no expected type given 2014-02-20 16:50:22 -05:00
Asumu Takikawa
2ae1f5a602 Fix top-level use of classes 2014-02-20 16:50:22 -05:00
Asumu Takikawa
dc35a8cd4d Type-check class top-level expressions 2014-02-20 16:50:22 -05:00
Asumu Takikawa
6a43fac5c2 Support tc-expr and not just tc-expr/check
Note: the type is too conservative in some cases with
      tc-expr (if you leave : annotations out). This should
      be fixed in the future.
2014-02-20 16:50:22 -05:00
Asumu Takikawa
709f3c6696 Add infrastructure for private methods
They don't actually work yet, because I don't yet know
how to assign them types for when they're called locally.
Probably requires the two pass approach for locals.
2014-02-20 16:50:22 -05:00
Asumu Takikawa
6c0e82f15b Add support for local field access 2014-02-20 16:50:22 -05:00
Asumu Takikawa
931556264e Add support for override 2014-02-20 16:50:22 -05:00
Asumu Takikawa
060aaa8b26 Check super-new calls
Still need to use this information to adjust the class
type init clauses
2014-02-20 16:50:21 -05:00
Asumu Takikawa
77847de944 Add unit tests for classes 2014-02-20 16:50:21 -05:00
Asumu Takikawa
244135a96e Initial work on type-checking class expressions
Add a `class:` macro that adds instrumentation for
the type-checker. Also add type-checking for the
expansion of that macro.
2014-02-20 16:50:21 -05:00
Asumu Takikawa
684fabde1b Clean up object init and add support for get-field 2014-02-20 16:50:21 -05:00
Asumu Takikawa
72c991c1de Add new Class type representation
This commit introduces a new Class type representation
and adds initial support for parsing the new types.

Existing uses of Class types are adjusted to compile.
2014-02-20 16:50:21 -05:00
John Clements
1f27fb7848 mcons doc typo fix
Closes PR 14345
2014-02-20 12:30:20 -08:00
Asumu Takikawa
745c6532d1 Restore optimization for two DrRacket TR files
Commit 2b9b16b165 fixed the issue
with the send expansion, so this can be re-enabled.
2014-02-20 15:02:41 -05:00
Asumu Takikawa
d35fb82f4a Make TR's for/hash form more flexible 2014-02-20 14:13:41 -05:00
Asumu Takikawa
58a3d12f0c Add TR case-lambda with optional type annotations 2014-02-20 13:54:32 -05:00
Asumu Takikawa
ed98404aaf TR: move helper syntax classes to helper file 2014-02-20 12:05:11 -05:00
Matthew Flatt
90f371a06a Another makefile CFLAGS/CPPFLAGS adjustment
Missed a spot in c97184b581.
2014-02-20 07:11:30 -07:00
Matthew Flatt
c97184b581 makefiles: adjust definition and handling of CFLAGS and CPPFLAGS
Try to make the makefiles work better if CFLAGS and/or CPPFLAGS
is defined externally.
2014-02-20 07:01:35 -07:00
Asumu Takikawa
8d4b3ee396 Add test for PR 13937
The actual bug was already fixed by enabling multi-valued
sequence syntax in TR `for` loop forms.

Closes PR 13937
2014-02-20 00:06:45 -05:00
Asumu Takikawa
a17e457840 Document legacy forms with a : suffix
Also don't export internal macros
2014-02-19 21:20:48 -05:00
Asumu Takikawa
768d04fa97 Revise TR Reference for new :-less forms 2014-02-19 16:40:40 -05:00
Asumu Takikawa
37b09521ac Provide :-less versions of all for forms.
Modify the forms as needed to accept non-annotated
bindings to match the untyped versions. Also fixes
bugs in syntax classes found along the way.
2014-02-19 16:40:40 -05:00
Asumu Takikawa
35ef2f90eb Accept polydots rest in TR lambda and define
Also accept type variables before formals in all cases
2014-02-19 16:40:40 -05:00
Asumu Takikawa
3d177e454e Enable mixed type annotations for define 2014-02-19 16:40:40 -05:00
Asumu Takikawa
967490cb22 Support polymorphism in both TR let and lambda 2014-02-19 16:40:40 -05:00
Asumu Takikawa
45d36579d3 Add :-less versions of struct macros 2014-02-19 16:40:40 -05:00
Asumu Takikawa
a941f95c2e Add a :-less do for TR 2014-02-19 16:40:40 -05:00
Asumu Takikawa
e6e3ab4e74 Make :-less versions of let variants in TR 2014-02-19 16:40:40 -05:00
Asumu Takikawa
a3d818c748 Add support for rest arguments in TR plain lambda
Two caveats:
  * in some positions : is not accepted as a formal
    when used in combination with * as a formal
  * the quality of parse error messages for rest
    argument types is traded for better optional argument
    error messages
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ad4f6e1ea1 Better error messages for TR lambda parsing 2014-02-19 16:40:40 -05:00
Asumu Takikawa
aef37edae4 Incorporate PR feedback 2014-02-19 16:40:40 -05:00
Asumu Takikawa
eb7a0f8797 Improve type-checker for optional arg functions 2014-02-19 16:40:40 -05:00
Asumu Takikawa
7e09362986 Allow TR lambda to have a result type annotation 2014-02-19 16:40:39 -05:00
Asumu Takikawa
8ea32c68f6 Improve TR lambda to accommodate type annotations
The new `lambda` form allows all combinations of arguments
with optional type annotations for all cases.
2014-02-19 16:40:39 -05:00
Robby Findler
19ad9918ec add some tests and start a "known bugs" test suite for the contract system 2014-02-19 14:46:31 -06:00
Asumu Takikawa
26204cf505 Fix TR double cast bug
In some cases, TR tried to typecheck the contents of a quote-syntax
form that contains unexpanded syntax.

Closes PR 14355
2014-02-18 23:28:49 -05:00
chrdimo
23f02e4575 updating option contract tests 2014-02-18 21:57:25 -05:00
Asumu Takikawa
0c0befac07 Add typed/pict which exports part of pict
Does not cover all of the bindings yet, but it
should just be a SMOP after the last extra-env-lang
feature additions.
2014-02-18 18:43:57 -05:00