Commit Graph

37 Commits

Author SHA1 Message Date
John Messerly 07feeb3119 js: fix core.Object, output order, static const fields
These are a few fixes trying to get the compiled SDK to load

R=vsm@google.com

Review URL: https://codereview.chromium.org/1011153002
2015-03-17 13:11:34 -07:00
John Messerly 212b217506 server: create output directory if needed
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1001503003
2015-03-11 12:22:58 -07:00
Sigmund Cherem 6d9564b4ff Support browser caching using hashes in serverMode (fixes #93, fixes #92).
Now the HTML can include a hash in the URL for cachable resources, and the serve knows how to include cache-control headers.

In the process of doing so, I had to change a couple things that made it possible to fix #92 as well (producing different output in the command-line than in server mode).

R=vsm@google.com

Review URL: https://codereview.chromium.org/993213003
2015-03-10 18:27:23 -07:00
Sigmund Cherem 4e4dd98e6b Add widget to display errors, and report graph errors correctly.
This fixes the compiler so that all error messages in dependency_graph are reported via the reporter and unifies how errors are constructed in other places as well. With all errors reported together, we use a widget (adapted from polymer) to display the error messages as part of the app in server mode.

R=vsm@google.com

Review URL: https://codereview.chromium.org/988483006
2015-03-09 11:37:22 -07:00
Sigmund Cherem ca80f2c473 Add JavaScriptSourceNode to represent runtime libraries (fixes #85)
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/986723002
2015-03-09 11:33:46 -07:00
Sigmund Cherem 0991bea1ef Allow changing a file from a part to a library, and viceversa.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/983553002
2015-03-09 10:59:18 -07:00
John Messerly 6e824067a3 rename ddc -> dev_compiler, fixes #84
R=sigmund@google.com

Review URL: https://codereview.chromium.org/967933005
2015-03-04 11:12:19 -08:00
Sigmund Cherem 7dd29efd8f Initial cut for a development server
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/973433003
2015-03-04 09:40:06 -08:00
Sigmund Cherem f7b7f43d28 Fixing layout in js output (use full paths rather than just the library name)
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/968273002
2015-03-03 09:05:09 -08:00
John Messerly 4d7aa8e397 add source maps support, fixes #50
R=sigmund@google.com

Review URL: https://codereview.chromium.org/965033002
2015-02-27 15:17:19 -08:00
Sigmund Cherem 9369b3e981 Fix new line breaks on }
R=leafp@google.com

Review URL: https://codereview.chromium.org/959073002
2015-02-26 14:32:48 -08:00
Vijay Menon 5c1c9c2381 Add LICENSE and corresponding headers
Fix expectations where line number has changed.

R=dgrove@google.com

Review URL: https://chromereviews.googleplex.com/158257013
2015-02-24 15:02:26 -08:00
Sigmund Cherem ce3dd48740 Accept compilng HTML files
R=jmesserly@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/153157013
2015-02-18 16:48:56 -08:00
Sigmund Cherem ae910f2860 Infer return types and field types based on overrides
R=jmesserly@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/145247013
2015-02-13 16:53:58 -08:00
Sigmund Cherem c08003a36e Add options and move the multi-package options to normal flags
R=jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/149487013
2015-02-13 13:04:16 -08:00
John Messerly 3438d26f5f check in SDK dart:core snapshot for tests
also tweaks the formatter to ignore it for ease of diffing

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/145337013
2015-01-28 16:41:34 -08:00
John Messerly c64afcf15a add SDK baseline
lots of things wrong with this generated code, but it's a start
(this builds on https://chromereviews.googleplex.com/148007013/)

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/147147014
2015-01-28 13:11:08 -08:00
John Messerly cad9b49ae4 generate JS per-library instead of per-unit
R=leafp@google.com

Review URL: https://chromereviews.googleplex.com/148007013
2015-01-28 12:51:45 -08:00
John Messerly 39746cb45e fixes to start codegen for sdk
R=leafp@google.com

Review URL: https://chromereviews.googleplex.com/145237013
2015-01-28 10:02:40 -08:00
Sigmund Cherem 2df05920ae Run formatter, remove dead code detected from analyzer
R=jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/145197013
2015-01-27 12:17:12 -08:00
Sigmund Cherem 763e61f4d3 Compile library-by-library. This is a step closer to our incremental compile.
As part of this change I made codegen synchronous. Technically is not necessary,
but I think it reduces complexity a lot. For example, keeping it async would
have required more changes to the testing infrastructure. Let me know if you
want to keep that change separate though.

With this change, I'm removing one more use of element.node, which is necessary
to achileve our goal. There is only one more use of this API, for which John has
a CL out.

BUG=
R=jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/145167013
2015-01-27 09:49:26 -08:00
Leaf Petersen fcf7a98525 Call method subtyping
Allow objects with an appropriately typed call method to subtype function types.  Fixes #19.

BUG=
R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/140757013
2015-01-13 16:10:48 -08:00
Leaf Petersen 37752f763c Relaxed casts
Allow implicit sideways casts between types that are assignable in regular dart.

BUG=
R=jacobr@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/135247013
2015-01-09 10:22:29 -08:00
Leaf Petersen d44e64d22a Covariant generic support
Add support for full covariant generics, under a flag.  Using --covariant-generics will make the checker use full covariance for generics.

BUG=
R=jacobr@google.com

Review URL: https://chromereviews.googleplex.com/140607013
2015-01-08 12:39:32 -08:00
Leaf Petersen efa7876cf2 Coercion reification, dart codegen URI rewriting, import fixups.
This CL adds a general reification pass which makes abstract coercions concrete by modifiying the ast.  Casts are reified as "as" expressions, and wrappers are reified by creating functions which take the old function as arguments and produce a new wrapped function.  There are a number of known issues not yet addressed:

1) No distinction between dart "as" and our special "as" is made yet.
2) Wrapper generation functions do not check for null arguments yet.
3) Types introduced via wrappers and "as" expressions are not yet added to the set of types for which new imports may be required.
4) Wrapper functions for non-literals can't be guaranteed not to change the runtime type without more backend support, since we only have their static type.

This CL also adds support for rewriting import directives in the dart backend to reflect the directory structure that we currently use for output.  Probably this should be rethought.  Currently I just use absolute file URIs, which is not what we want.

This CL also adds support for adding in the import directives needed to account for type names added via inference.  This is not yet correct for "part of" files, since we need to add the imports to the main library file.

BUG=
R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/137957013
2015-01-07 13:53:16 -08:00
Jacob Richman b4999ee290 Support writing error messages directly to file.
BUG=
R=sigmund@google.com

Review URL: https://chromereviews.googleplex.com/134137013
2015-01-05 16:18:45 -08:00
Sigmund Cherem c95d72647a Run latest formatter
Review URL: https://chromereviews.googleplex.com/131387013
2014-12-29 13:01:35 -08:00
Sigmund Cherem 4448f18cea Add a reporter, remove caching of source files and recording of info (in progress)
R=leafp@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/132767014
2014-12-19 15:10:38 -08:00
Sigmund Cherem 288d73fcba A couple fixes in the checker:
- report analyzer errors earlier (before we are processing a unit)
 - fix checks for redirecting and super constructors.

BUG=
R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/132017013
2014-12-16 16:18:29 -08:00
John Messerly 0493ac3271 initial sunflower changes
still some things unimplemented, but since we're all hitting the same paths figured I'd land what I have so far

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/125537013
2014-12-16 14:10:08 -08:00
Sigmund Cherem 706c749203 Initial changes to report some summary data from the checker.
R=jmesserly@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/130017014
2014-12-16 10:38:17 -08:00
Sigmund Cherem 2a9588da40 report errors found by analyzer too.
R=jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/131967013
2014-12-15 19:27:58 -08:00
Sigmund Cherem 19a59bb80f rename emitter to codegen
R=jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/126387013
2014-12-11 17:15:10 -08:00
Sigmund Cherem 1c6787f47c Run the latest formatter on all files.
R=jmesserly@google.com

Review URL: https://chromereviews.googleplex.com/130817013
2014-12-11 16:33:01 -08:00
Sigmund Cherem 02a4650a24 Refactor: move code around a bit
- bin/
    devc.dart

- lib/
    devc.dart

    src/
       info.dart # static info we compute, used by checker & backends
       checker/  # implementation details for the checker
          checker.dart  # checking algorithm
          rules.dart    # type checking rules
          resolver.dart # same as today, type resolution via analyzer
       emitter/
          ...
- test/
     checker/    # unit tests for the checker internals
     codegen/    # left as is - maybe should rename to emitter?
     samples/    # stand alone samples that we run in the end_to_end tests.
     ...

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/128957013
2014-12-11 15:13:54 -08:00
Leaf Petersen eef8c94795 Skeleton for new checker and dart backend
This adds a skeleton new type checker which just reuses the existing checker for now, but will be filled in with the new type rules.

It also adds a dart backend code generator which currently just spits out the original dart code unchanged (except for (lack of) formatting) into the output directory.  By default it uses the dart_style formatter to format the output.  This sometimes hits issues, so there is an option to turn this off.

There are flags to control the various options added.

BUG=
R=jmesserly@google.com, vsm@google.com

Review URL: https://chromereviews.googleplex.com/128857013
2014-12-11 13:01:01 -08:00
John Messerly 3124c7ec89 add the ability to easily test codegen by diffing against expected output
this makes changes easy to spot

some of this code was taken from old polymer.dart test scripts :)

R=sigmund@google.com

Review URL: https://chromereviews.googleplex.com/121567013
2014-12-09 16:52:05 -08:00