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

Side by Side Diff: reflectable/lib/src/encoding_constants.dart

Issue 1391543003: Creates `reflectors`, as a meta-meta feature that enables dynamic selection of a "mirror system". (Closed) Base URL: https://github.com/dart-lang/reflectable.git@master
Patch Set: Review response. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « reflectable/lib/reflectable.dart ('k') | reflectable/lib/src/reflectable_mirror_based.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in 2 // source code is governed by a BSD-style license that can be found in
3 // the LICENSE file. 3 // the LICENSE file.
4 4
5 library reflectable.encoding_constants; 5 library reflectable.encoding_constants;
6 6
7 // The first `flagsBit-1` bits are used to enumerate the "kind" of the 7 // The first `flagsBit-1` bits are used to enumerate the "kind" of the
8 // declaration. The more significant bits are flags. 8 // declaration. The more significant bits are flags.
9 const flagsBit = 4; 9 const flagsBit = 4;
10 10
11 // Kinds: 11 // Kinds:
12 const generativeConstructor = 0; 12 const generativeConstructor = 0;
13 const factoryConstructor = 1; 13 const factoryConstructor = 1;
14 const method = 2; 14 const method = 2;
15 const getter = 3; 15 const getter = 3;
16 const setter = 4; 16 const setter = 4;
17 const field = 5; 17 const field = 5;
18 const parameter = 6; 18 const parameter = 6;
19 const clazz = 7; // Cannot use keyword `class`.
19 20
20 // Flags: 21 // Flags:
21 const staticAttribute = 1 << (flagsBit); 22 const staticAttribute = 1 << (flagsBit);
22 const privateAttribute = 1 << (flagsBit + 1); 23 const privateAttribute = 1 << (flagsBit + 1);
23 const syntheticAttribute = 1 << (flagsBit + 2); 24 const syntheticAttribute = 1 << (flagsBit + 2);
24 const constAttribute = 1 << (flagsBit + 3); 25 const constAttribute = 1 << (flagsBit + 3);
25 const redirectingConstructorAttribute = 1 << (flagsBit + 4); 26 const redirectingConstructorAttribute = 1 << (flagsBit + 4);
26 const abstractAttribute = 1 << (flagsBit + 5); 27 const abstractAttribute = 1 << (flagsBit + 5);
27 const finalAttribute = 1 << (flagsBit + 6); 28 const finalAttribute = 1 << (flagsBit + 6);
28 const hasDefaultValueAttribute = 1 << (flagsBit + 7); 29 const hasDefaultValueAttribute = 1 << (flagsBit + 7);
29 const optionalAttribute = 1 << (flagsBit + 8); 30 const optionalAttribute = 1 << (flagsBit + 8);
30 const namedAttribute = 1 << (flagsBit + 9); 31 const namedAttribute = 1 << (flagsBit + 9);
31 const dynamicAttribute = 1 << (flagsBit + 10); 32 const dynamicAttribute = 1 << (flagsBit + 10);
32 const classTypeAttribute = 1 << (flagsBit + 11); 33 const classTypeAttribute = 1 << (flagsBit + 11);
33 const dynamicReturnTypeAttribute = 1 << (flagsBit + 12); 34 const dynamicReturnTypeAttribute = 1 << (flagsBit + 12);
34 const classReturnTypeAttribute = 1 << (flagsBit + 13); 35 const classReturnTypeAttribute = 1 << (flagsBit + 13);
35 const voidReturnTypeAttribute = 1 << (flagsBit + 14); 36 const voidReturnTypeAttribute = 1 << (flagsBit + 14);
37 const enumAttribute = 1 << (flagsBit + 15);
36 38
37 int kindFromEncoding(int encoding) => encoding & ((1 << flagsBit) - 1); 39 int kindFromEncoding(int encoding) => encoding & ((1 << flagsBit) - 1);
38 40
39 /// Used in place of an index into a list, where a needed capability to provide 41 /// Used in place of an index into a list, where a needed capability to provide
40 /// the actual value is missing. 42 /// the actual value is missing.
41 const int NO_CAPABILITY_INDEX = -1; 43 const int NO_CAPABILITY_INDEX = -1;
OLDNEW
« no previous file with comments | « reflectable/lib/reflectable.dart ('k') | reflectable/lib/src/reflectable_mirror_based.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698