rand dart fix
This commit is contained in:
@@ -132,7 +132,6 @@ void _processFile(
|
||||
if (item.isValid) {
|
||||
if (!cache.addName(item.name)) continue;
|
||||
final _template = _processClass(item, input);
|
||||
if (_template == null) continue;
|
||||
final name = ReCase(item.name).snakeCase;
|
||||
final _path = 'classes/' + name + '.dart';
|
||||
final _file = _getFile(output.path, _path);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'src/index.dart';
|
||||
export 'src/index.dart';
|
||||
|
||||
DartResult parseSource(String source, [String path]) {
|
||||
assert(source != null && source.isNotEmpty);
|
||||
assert(source.isNotEmpty);
|
||||
final result = parseString(
|
||||
content: source,
|
||||
path: path,
|
||||
|
||||
@@ -25,10 +25,10 @@ extension ClauseDeclarationImplUtils on ClassDeclarationImpl {
|
||||
comments.add(item.toDartComment());
|
||||
}
|
||||
return base.copyWith(
|
||||
isAbstract: this?.abstractKeyword != null,
|
||||
extendsClause: this?.extendsClause?.toString(),
|
||||
implementsClause: this?.implementsClause?.toString(),
|
||||
withClause: this?.withClause?.toString(),
|
||||
isAbstract: this.abstractKeyword != null,
|
||||
extendsClause: this.extendsClause?.toString(),
|
||||
implementsClause: this.implementsClause?.toString(),
|
||||
withClause: this.withClause?.toString(),
|
||||
fields: fields,
|
||||
constructors: constructors,
|
||||
methods: methods,
|
||||
|
||||
@@ -51,12 +51,11 @@ extension DefaultFormalParameterImplUtils on DefaultFormalParameterImpl {
|
||||
base = base.copyWith(name: child.toString());
|
||||
}
|
||||
}
|
||||
if (fields != null)
|
||||
for (final field in fields) {
|
||||
if (field.name == base.name) {
|
||||
base = base.copyWith(type: field.type);
|
||||
}
|
||||
for (final field in fields) {
|
||||
if (field.name == base.name) {
|
||||
base = base.copyWith(type: field.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (node.runtimeType.toString() == 'SimpleToken' &&
|
||||
node.toString() == '=') {
|
||||
|
||||
@@ -38,22 +38,22 @@ class GenParser {
|
||||
|
||||
void merge(String source) {
|
||||
final DartResult result = parseSource(source);
|
||||
if (result?.file != null) {
|
||||
if (result?.file?.classes != null) {
|
||||
if (result.file != null) {
|
||||
if (result.file?.classes != null) {
|
||||
for (final item in result.file.classes) {
|
||||
this._classes.putIfAbsent(item.name, () => item);
|
||||
}
|
||||
}
|
||||
if (result?.file?.enums != null) {
|
||||
if (result.file?.enums != null) {
|
||||
this._enums.addAll(result.file.enums);
|
||||
}
|
||||
if (result?.file?.fields != null) {
|
||||
if (result.file?.fields != null) {
|
||||
this._fields.addAll(result.file.fields);
|
||||
}
|
||||
if (result?.file?.methods != null) {
|
||||
if (result.file?.methods != null) {
|
||||
this._methods.addAll(result.file.methods);
|
||||
}
|
||||
if (result?.file?.imports != null) {
|
||||
if (result.file?.imports != null) {
|
||||
this._imports.addAll(result.file.imports);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user