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

Side by Side Diff: tools/immic/lib/src/primitives.dart

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 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 | « tools/immic/lib/src/plugins/shared.dart ('k') | tools/immic/lib/src/resolver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library immic.primitives;
6
7 enum PrimitiveType {
8 VOID,
9 BOOL,
10
11 UINT8,
12 UINT16,
13
14 INT8,
15 INT16,
16 INT32,
17 INT64,
18
19 FLOAT32,
20 FLOAT64
21 }
22
23 int size(PrimitiveType type) {
24 switch (type) {
25 case PrimitiveType.VOID: return 0;
26
27 case PrimitiveType.BOOL:
28 case PrimitiveType.INT8:
29 case PrimitiveType.UINT8: return 1;
30
31 case PrimitiveType.INT16:
32 case PrimitiveType.UINT16: return 2;
33
34 case PrimitiveType.FLOAT32:
35 case PrimitiveType.INT32: return 4;
36
37 case PrimitiveType.FLOAT64:
38 case PrimitiveType.INT64: return 8;
39 }
40 return -1;
41 }
42
43 PrimitiveType lookup(String identifier) {
44 Map<String, PrimitiveType> types = const {
45 'void' : PrimitiveType.VOID,
46 'bool' : PrimitiveType.BOOL,
47
48 'uint8' : PrimitiveType.UINT8,
49 'uint16' : PrimitiveType.UINT16,
50
51 'int8' : PrimitiveType.INT8,
52 'int16' : PrimitiveType.INT16,
53 'int32' : PrimitiveType.INT32,
54 'int64' : PrimitiveType.INT64,
55
56 'float32' : PrimitiveType.FLOAT32,
57 'float64' : PrimitiveType.FLOAT64,
58 };
59 return types[identifier];
60 }
OLDNEW
« no previous file with comments | « tools/immic/lib/src/plugins/shared.dart ('k') | tools/immic/lib/src/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698