Commit Graph

297 Commits

Author SHA1 Message Date
danrubel@google.com d2ee00cfaa Ensure usage of short form (e.g. dart:io rather than dart://io/io_runtime.dart) if available
Review URL: https://chromiumcodereview.appspot.com//9958074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6106 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 19:42:56 +00:00
danrubel@google.com 0038d2e303 Resolve all new libraries when called from AnalysisServer
Review URL: https://chromiumcodereview.appspot.com//9963062

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6100 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 18:12:23 +00:00
zundel@google.com 27237ce51e Implements error recovery for cases where 'var' or 'final' prefix a method def'n
These are common user mistakes, it prints a reasonable diagnostic
as opposed to 'unexpected token'.

Review URL: https://chromiumcodereview.appspot.com//9950045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6078 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-01 16:55:56 +00:00
zundel@google.com f8c2584f55 Fix bad merge in CommandLineOptions.java (broke build at r6076)
Review URL: https://chromiumcodereview.appspot.com//9958050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6077 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-01 03:30:25 +00:00
zundel@google.com 9dae63b313 Add some command line options to debug AST parsing of illegal dart
There are 2 cmdline options added in this change
 1.  --source-from-ast  reprints out the source by walking whatever
AST was constructed from the parse.  This helps visualize what the
partially constructued AST looks like.
 2. --resolve-on-parse-errors this option has been availble to
API users, now it is exposed on the commandline.

Used together, you can take dart source that doesn't parse and see
how well the static analyzer understand it.

Review URL: https://chromiumcodereview.appspot.com//9958049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6076 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-01 03:23:15 +00:00
zundel@google.com 457c114b8b Removed unused dartc 'disable-type-optimization' command line flag
Review URL: https://chromiumcodereview.appspot.com//9950044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6075 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-01 02:19:42 +00:00
scheglov@google.com 196233e0b1 Visit name of DartDeclaration, set Element for DartIdentifier
After this we could remove some of the workarounds in Editor.

R=zundel@google.com,messick@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9921015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6037 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 14:09:26 +00:00
danrubel@google.com fd571b647c Prevent duplicate entries in the bundled libraries
Review URL: https://chromiumcodereview.appspot.com//9909012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5999 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 19:48:12 +00:00
devoncarew@google.com 6168203caa Fix for tooltips for fields not returning their types (just their name).
Review URL: https://chromiumcodereview.appspot.com//9874019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5958 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 22:28:12 +00:00
zundel@google.com 0fbb7dc611 Remove error message when compile time constants used in +,-,/,* expressions
The type of sub expressions was computed to be 'number' for
integer math expressions.  This caused an inappropriate
error message 'Not a compile time constant, expected int, got num'

Review URL: https://chromiumcodereview.appspot.com//9875002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5939 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 17:15:07 +00:00
scheglov@google.com e6ca492a83 Remove AST dumps, useless for Editor
R=brianwilkerson@google.com,zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9692006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5938 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 17:10:33 +00:00
devoncarew@google.com 32cd1b2d24 Fix for a windows path issue.
Review URL: https://chromiumcodereview.appspot.com//9844022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5936 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 16:58:11 +00:00
zundel@google.com e5ca48a7d5 Removes dartc reliance on its own libraries, now can be targeted at any implementation's libraries
Adds a new cmdline flags

--dart-sdk to point it at a directory where the dart library files are staged
--platform the name of the platform {dartium, vm, frog, dart2js}
to target with the analyzer

Committed: https://code.google.com/p/dart/source/detail?r=5885

Review URL: https://chromiumcodereview.appspot.com//9860009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5930 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 14:20:29 +00:00
zundel@google.com aa04541e71 Dartc erroneously reported a compile-time error on a const class with a non-final static field
Review URL: https://chromiumcodereview.appspot.com//9860051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5913 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 21:34:05 +00:00
zundel@google.com 1486f2602d Revert "Removes dartc reliance on its own libraries, now can be targeted at any implementation's libraries"
This reverts commit r5885 which works locally, but not on the builder

Review URL: https://chromiumcodereview.appspot.com//9865025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5886 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 17:04:03 +00:00
zundel@google.com b838d39acb Removes dartc reliance on its own libraries, now can be targeted at any implementation's libraries
Adds a new cmdline flags

--dart-sdk to point it at a directory where the dart library files are staged
--platform the name of the platform {dartium, vm, frog, dart2js}
to target with the analyzer

Review URL: https://chromiumcodereview.appspot.com//9860009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5885 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 16:25:54 +00:00
danrubel@google.com 1dc4683926 Fix tests when AnalysisServer disabled
Review URL: https://chromiumcodereview.appspot.com//9865023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5882 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 15:58:07 +00:00
danrubel@google.com a49c90d738 Address comments on AnalysisServer fixes
Review URL: https://chromiumcodereview.appspot.com//9860034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5878 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 14:39:19 +00:00
scheglov@google.com 94c35b872a Initial implementation of "Rename Local Variable" refactoring.
R=messick@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9834028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5875 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 12:43:13 +00:00
zundel@google.com 3d07831594 Some compile time constants were not properly reporting static type warnings
http://code.google.com/p/dart/issues/detail?id=1957

Review URL: https://chromiumcodereview.appspot.com//9728006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5654 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 19:27:35 +00:00
brianwilkerson@google.com 2bb37f16b7 Close a stream when done
Review URL: https://chromiumcodereview.appspot.com//9716005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5595 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 21:36:28 +00:00
scheglov@google.com 575055777e Remove Element.getNode() method
1. Use NodeElement in CompletionEngine

2. Don't use Element.getNode() in DartElementLocator

3. New tests for DartElementLocator

4. Clean up DartC tests to use NodeElement

R=brianwilkerson@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9703096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5586 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 19:08:39 +00:00
scheglov@google.com 94dd8e61cf Use NodeElement in SupertypeResolver
Use Element.getNameLocation() in TopLevelElementBuilder

R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9699030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5475 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 17:33:41 +00:00
scheglov@google.com 075b34c834 Use NodeElement to access Node in Resolver
Note, that such access it type safe, because we return NodeElement from corresponding Node subclasses, return other NodeElements from NodeElement accessors, etc.

R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9700019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5471 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 15:22:39 +00:00
scheglov@google.com 2fa3dd49f1 Add ClassNodeElement and allow Analyzer to use cached unimplemented members
Several other clean ups in Analyzer.

R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9689080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5464 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 13:31:40 +00:00
zundel@google.com b2b58c971e Allow const factory on methods in parser
This got left out of an earlier patch.

Review URL: https://chromiumcodereview.appspot.com//9704006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5449 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 00:36:56 +00:00
zundel@google.com c11ae36c38 Fixes cyclic constructor issue in dartc
I moved leg's test into language since the same test replicated the problem.

Review URL: https://chromiumcodereview.appspot.com//9689086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5447 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 00:19:23 +00:00
brianwilkerson@google.com bd527bcea7 Step 1: Introduce a new method for source objects that will replace the current getUri
Review URL: https://chromiumcodereview.appspot.com//9677062

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5440 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 21:49:26 +00:00
scheglov@google.com 4d8693d237 Remove unused code in ResolveVisitor
R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9677055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5429 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 19:25:08 +00:00
zundel@google.com f9205b7150 Allow "const ... native" constructors and "const factory ... native" constructors in dartc
These are used in the VM and frog core library implementations.

Review URL: https://chromiumcodereview.appspot.com//9695057

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5428 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 19:20:30 +00:00
scheglov@google.com b91c22338f Visit Node in CompileTimeConstantAnalyzer only if Node based
...in other case expect that FieldElement will return type from getConstantType().

R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9689063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5425 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 18:25:48 +00:00
scheglov@google.com 736155d448 Fixes for previous CL review comments
R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9695025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5375 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 00:53:51 +00:00
scheglov@google.com ed2a5d0779 Step back and remove more getNode() invocations
In many cases we need Element.getNode() only for producing error.
This CL changes these places and well as other places where we can easily use only Elements without getNode().

R=zundel@google.com,brianwilkerson@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9692002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5349 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-12 19:39:34 +00:00
zundel@google.com f98d82c284 Update analysis to support adjacent string literals
http://code.google.com/p/dart/issues/detail?id=2079

Review URL: https://chromiumcodereview.appspot.com//9666015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5255 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 21:44:08 +00:00
scheglov@google.com b2e15e7451 Make SourceInfo a class, rename its menthods.
This is preparation for avoiding calling Element.getNode() during analysis.

R=brianwilkerson@google.com,zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9651004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5208 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 01:33:34 +00:00
scheglov@google.com b724c6f5be Use Element instead of Symbol.
Return typed Element where possible.

R=brianwilkerson@google.com,zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9633009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5178 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 17:01:46 +00:00
danrubel@google.com 2284f69669 Properly resolve relative paths with spaces
Review URL: https://chromiumcodereview.appspot.com//9608003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5150 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 03:24:40 +00:00
zundel@google.com e72ab9487d Fix NPE in dartc
Review URL: https://chromiumcodereview.appspot.com//9639002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5147 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 01:20:09 +00:00
zundel@google.com 7f8a57919b Specify the types for Element.classes, Element.elements and Node.nodes
Previously these lines gave type errors in dartc, but now they pass
without warnings.

b/5392897

Review URL: https://chromiumcodereview.appspot.com//9315061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5136 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 23:02:08 +00:00
zundel@google.com 3e4c6f2eb4 Fixes TypeVariableBoundsTest/01 for dartc
A problem that should have been flagged as a static-type warning
was flagged as a compile-time error instead.

http://code.google.com/p/dart/issues/detail?id=1900

Review URL: https://chromiumcodereview.appspot.com//9618029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5092 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 14:19:02 +00:00
zundel@google.com a7669d35cc Type assignment errors should be static type warnings, not compile-time errors
http://code.google.com/p/dart/issues/detail?id=1939

Review URL: https://chromiumcodereview.appspot.com//9605024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5053 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 20:58:56 +00:00
brianwilkerson@google.com 824be842fc Fix a bug that caused editor to not get notified when files were compiled if there were errors early enough in the process.
Review URL: https://chromiumcodereview.appspot.com//9616031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5051 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 20:46:55 +00:00
scheglov@google.com 4b6c9f54f9 Use NodeList where possible.
R=brianwilkerson@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9600049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5036 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 17:45:10 +00:00
jacobr@google.com de1d525459 Enable new dart:html wrapperless frog bindings and wrapper dartium bindings.
Split unittest.dart into unittest_html and unittest_dom

Bug fixes to the new dart:html bindings to compile with dartc.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9600035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4998 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 00:30:09 +00:00
danrubel@google.com b06f633867 New analyzeLibraries method
Review URL: https://chromiumcodereview.appspot.com//9601005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4970 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 18:53:35 +00:00
danrubel@google.com 7d2e793cba Update native keyword checking to accommodate frog
Review URL: https://chromiumcodereview.appspot.com//9585003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4969 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 18:53:08 +00:00
devoncarew@google.com ebc6743226 Remove a build and 3-4 compiler warnings from com.google.dart.compiler.js.
Review URL: https://chromiumcodereview.appspot.com//9595024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4964 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 17:48:00 +00:00
scheglov@google.com 15cd929a08 Use ASTVisitor as in new AST.
I'm going to morph DartC to use new AST step by step.
We need to have new AST, even with old parser, to easily switch later to the resilient parser and also for any other future work on refactoring, quick assists, etc.

R=brianwilkerson@google.com,zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9598002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4962 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 17:36:40 +00:00
zundel@google.com 0f3ef6185e Removes unused 'normalized' field in many AST nodes.
Review URL: https://chromiumcodereview.appspot.com//9597025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4959 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 16:41:06 +00:00
zundel@google.com ab603367c0 Update test.dart for detection output of machine formatted errors
This change causes the 'dartc' tests to be more sensitive to the difference
between a static type error and a compilation error.   Instead of
relying on the return value from the test being 0 or non zero, the
code now turns on '--error_format machine' and checks type
error level 'ERROR' or 'WARNING' and the type of error for
'STATIC_TYPE' if there is a static type error.  A new annotation
format adapted from multitests is introduced for standard test cases:

  int foo = "hello";   /// static type error

The above annotation means that a static type error is expected.
Currently enforcement is very lenient.  There must be at least as
many STATIC_TYPE error messages as there are '/// static type error'
annotations (and no ERROR level messages.)

Review URL: https://chromiumcodereview.appspot.com//9559007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4895 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 18:50:09 +00:00