Commit Graph

314 Commits

Author SHA1 Message Date
zundel@google.com bfbc8f4ff4 Improve parser recovery inside of a block
Review URL: https://chromiumcodereview.appspot.com//10024009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6305 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 17:25:37 +00:00
messick@google.com 1c6a2105b8 Teach DeltaAnalyzer to recognize library prefixes.
Review URL: https://chromiumcodereview.appspot.com//10024002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6303 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 01:57:55 +00:00
zundel@google.com 5bcc817ce2 Using annotations to help with parser recovery
There are cases in the parser where a method is consuming tokens aren't
expected at that level, but could have been used to sucessfully complete
a non-terminal further up in the stack.

This change adds an annotation @Terminals that is consulted when
an unexpected token is encountered to determine whether or not the
token should be consumed.  Adding a token to @Terminals tells the
parser it is OK not to consume that token, that the parser will eventually
make progress.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6299 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 22:54:33 +00:00
zundel@google.com 191810e590 Add element to qualifier name for code completion
http://code.google.com/p/dart/issues/detail?id=2422

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6272 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 14:26:11 +00:00
zundel@google.com e1da301847 Error recovery for unsupported operator overloads
Review URL: https://chromiumcodereview.appspot.com//10012012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6245 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 20:06:38 +00:00
zundel@google.com 4d40985460 Implement @runtime-error in co19 tests for static analysis (no runtime)
http://code.google.com/p/dart/issues/detail?id=2406

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6243 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 19:39:38 +00:00
zundel@google.com ec609edb6d Adds fixes for the 'super' keyword used by itself in certain situations
Review URL: https://chromiumcodereview.appspot.com//9949016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6240 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 18:48:42 +00:00
scheglov@google.com 3ae8698f48 Report missing #source after 'unitAboutToCompile'
R=zundel@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6220 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 14:58:43 +00:00
zundel@google.com f3c3451cbf Show an error if a field has no getter defined in a getter context
http://code.google.com/p/dart/issues/detail?id=2408

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6199 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-04 21:51:46 +00:00
scheglov@google.com 52324c399c Remember visibility range for DartVariable
This will allow us to check name conflicts between local variables during refactoring.

R=brianwilkerson@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6192 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-04 20:22:13 +00:00
zundel@google.com 969d4caa18 Make sure toplevel final fields are initialized
http://code.google.com/p/dart/issues/detail?id=2372

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6184 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-04 18:05:12 +00:00
zundel@google.com c4d9d56627 Dartc's 'can't use a type variable in static context' message now works the same way as 'NO_SUCH_TYPE'
The error message for can't use a type variable in a static
context is useful, but it was an unconditional error.  Really,
the message is just a more friendly version of 'NO_SUCH_TYPE' and
needs to work in the same way, being a warning in some contexts, and
a compile time error in others.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6146 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 20:32:23 +00:00
scheglov@google.com 22ef1c8c6a Issue 2420. Better error message for 'duplicate top-level definition'
http://code.google.com/p/dart/issues/detail?id=2420

R=zundel@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6142 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 19:40:53 +00:00
zundel@google.com 9f9f6ffe34 Prevent NPE in TypeAnalyzer
This came from a bug report in the editor without a
specific repro case, so I just added protection
at the several places on the line where fetching the
type arguments might hit a null pointer.  If I had
a repro case, I would work on preventing the null pointer
from getting in there in the first place.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6140 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 19:07:16 +00:00
devoncarew@google.com 46a4edf55f Fix for an issue where reported line positions on windows files were off by a factor of 2.
Review URL: https://chromiumcodereview.appspot.com//9959103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6130 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 17:53:39 +00:00
zundel@google.com 17c8c7acc1 More error recovery back to the top level for some cases
Review URL: https://chromiumcodereview.appspot.com//9959054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6113 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 21:32:26 +00:00
danrubel@google.com 51a35a9051 Entries for relatively referenced system libraries to prevent duplicate resolution
Review URL: https://chromiumcodereview.appspot.com//9959076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6109 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 20:11:30 +00:00
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