Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Issue 1410383004: Introduce an "idl"-like format description for analyzer summaries. (Closed)

Created:
5 years, 2 months ago by Paul Berry
Modified:
5 years, 2 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Introduce an "idl"-like format description for analyzer summaries. Not yet used. This is mostly copied from experiments done earlier in the year, and is therefore incomplete; I plan to refine this in the process of fleshing out the implementation and tests. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/fc1f07fe2ee04640917751607ceaea6b031d9a1d

Patch Set 1 #

Total comments: 20
Unified diffs Side-by-side diffs Delta from patch set Stats (+581 lines, -0 lines) Patch
A pkg/analyzer/tool/summary/idl.dart View 1 chunk +581 lines, -0 lines 20 comments Download

Messages

Total messages: 7 (1 generated)
Paul Berry
5 years, 2 months ago (2015-10-20 00:00:12 UTC) #2
scheglov
LGTM https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/idl.dart File pkg/analyzer/tool/summary/idl.dart (right): https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/idl.dart#newcode59 pkg/analyzer/tool/summary/idl.dart:59: class Flag { Is it an enumeration, a ...
5 years, 2 months ago (2015-10-20 00:20:22 UTC) #3
Paul Berry
https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/idl.dart File pkg/analyzer/tool/summary/idl.dart (right): https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/idl.dart#newcode59 pkg/analyzer/tool/summary/idl.dart:59: class Flag { On 2015/10/20 00:20:22, scheglov wrote: > ...
5 years, 2 months ago (2015-10-20 15:54:09 UTC) #4
Paul Berry
Committed patchset #1 (id:1) manually as fc1f07fe2ee04640917751607ceaea6b031d9a1d (presubmit successful).
5 years, 2 months ago (2015-10-20 16:09:47 UTC) #5
Brian Wilkerson
https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/idl.dart File pkg/analyzer/tool/summary/idl.dart (right): https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/idl.dart#newcode119 pkg/analyzer/tool/summary/idl.dart:119: * Index into [LibraryElement.dependencies] indicating which imported library "LibraryElement" ...
5 years, 2 months ago (2015-10-20 18:07:15 UTC) #6
Paul Berry
5 years, 2 months ago (2015-10-20 18:46:20 UTC) #7
Message was sent while issue was closed.
Thanks, Brian.  I'll address your issues in follow-up CLs.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
File pkg/analyzer/tool/summary/idl.dart (right):

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:119: * Index into
[LibraryElement.dependencies] indicating which imported library
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> "LibraryElement" --> "UnlinkedLibrary"?

Whoops, thanks.  I forgot to update this when I made my final decision on
nomenclature.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:120: * declares the entity being referred to.
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> It isn't clear whether indexes like this one are zero based or one based.
There
> are places where an index is described as being "... or zero if ...", which
> implies that zero isn't a valid index, but there are also places where you
> explicitly state "A one based index ...".

You're right, this isn't particularly clear.  In a future CL I will experiment
with alternatives.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:124: @Flag('CLASS', 0, 'Indicates that the
thing being referred to is a class')
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> Does "class" here include "enum", or should that be a separate flag?

It includes enum.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:130: int flags;
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> Another possibility here would be to declare 'bool' valued fields and leave it
> up to the code generator to decide how / whether to compact those fields. For
> example:
> 
> /**
>  * Indicates that the thing being referred to is a class.
>  */
> bool isClass;
> 
> /**
>  * Indicates that the thing being referred to is a typedef
>  */
> bool isTypedef;

I like this idea.  I will experiment with this in a future CL.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:156: * a supertype.
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> Or if the class is `Object` and hence has no supertype?

Correct.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:213: * Values listed in the enum declaration.
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> Presumably in declaration order? (It isn't clear which lists preserve lexical
> order and which don't. Perhaps they all do, in which cases a general statement
> to that effect would help.)

Yes, this one has to be in declaration order because the enum value is inferred
from the order.

As to the general question of how declarations are sorted, I don't know.  I'll
give it some thought.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:271: * parameters, and setters have a single
parameter.
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> Do getters have an empty list, or `null`?

In keeping with protobuf semantics, I'm planning to have the code generation
logic treat null as equivalent to the empty list.  I'll clarify this in the
comments.

https://codereview.chromium.org/1410383004/diff/1/pkg/analyzer/tool/summary/i...
pkg/analyzer/tool/summary/idl.dart:294: * Relative URI used to reference the
exported library.
On 2015/10/20 18:07:14, Brian Wilkerson wrote:
> I assume that "Relative URI" (here and below) really means "the URI that
appears
> in source code". ("Absolute" and "relative" have meanings in URI-speak.)

Correct.

Powered by Google App Engine
This is Rietveld 408576698