| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library fasta.kernel_library_builder; | 5 library fasta.kernel_library_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart'; | 7 import 'package:kernel/ast.dart'; |
| 8 | 8 |
| 9 import 'package:kernel/clone.dart' show CloneVisitor; | 9 import 'package:kernel/clone.dart' show CloneVisitor; |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 nativeMethodName, | 241 nativeMethodName, |
| 242 redirectionTarget); | 242 redirectionTarget); |
| 243 currentDeclaration.addFactoryDeclaration(procedure, factoryDeclaration); | 243 currentDeclaration.addFactoryDeclaration(procedure, factoryDeclaration); |
| 244 addBuilder(name, procedure, charOffset); | 244 addBuilder(name, procedure, charOffset); |
| 245 if (nativeMethodName != null) { | 245 if (nativeMethodName != null) { |
| 246 addNativeMethod(procedure); | 246 addNativeMethod(procedure); |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 void addEnum(List<MetadataBuilder> metadata, String name, | 250 void addEnum(List<MetadataBuilder> metadata, String name, |
| 251 List<String> constants, int charOffset, int charEndOffset) { | 251 List<Object> constantNamesAndOffsets, int charOffset, int charEndOffset) { |
| 252 addBuilder( | 252 addBuilder( |
| 253 name, | 253 name, |
| 254 new KernelEnumBuilder( | 254 new KernelEnumBuilder(metadata, name, constantNamesAndOffsets, this, |
| 255 metadata, name, constants, this, charOffset, charEndOffset), | 255 charOffset, charEndOffset), |
| 256 charOffset); | 256 charOffset); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void addFunctionTypeAlias( | 259 void addFunctionTypeAlias( |
| 260 List<MetadataBuilder> metadata, | 260 List<MetadataBuilder> metadata, |
| 261 KernelTypeBuilder returnType, | 261 KernelTypeBuilder returnType, |
| 262 String name, | 262 String name, |
| 263 List<TypeVariableBuilder> typeVariables, | 263 List<TypeVariableBuilder> typeVariables, |
| 264 List<FormalParameterBuilder> formals, | 264 List<FormalParameterBuilder> formals, |
| 265 int charOffset) { | 265 int charOffset) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 | 429 |
| 430 bool isConstructorName(String name, String className) { | 430 bool isConstructorName(String name, String className) { |
| 431 if (name.startsWith(className)) { | 431 if (name.startsWith(className)) { |
| 432 if (name.length == className.length) return true; | 432 if (name.length == className.length) return true; |
| 433 if (name.startsWith(".", className.length)) return true; | 433 if (name.startsWith(".", className.length)) return true; |
| 434 } | 434 } |
| 435 return false; | 435 return false; |
| 436 } | 436 } |
| OLD | NEW |