Skip to content

Commit

Permalink
type parser with end por List<String>
Browse files Browse the repository at this point in the history
  • Loading branch information
juancastillo0 committed Jul 26, 2021
1 parent 1c22710 commit 561785e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/parsers/type_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ class PrimitiveParser extends JsonTypeParser {
throw '';
}

static final parser = ((string('int') |
string('double') |
string('num') |
string('String') |
string('bool') |
static final parser = ((string('int').end() |
string('double').end() |
string('num').end() |
string('String').end() |
string('bool').end() |
(identifier &
(char('<') &
identifier.separatedBy(char(','),
Expand Down
4 changes: 4 additions & 0 deletions lib/parsers/type_parser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ void main() {
(r2.value.genericType as PrimitiveParser).type.toEnumString(), 'int');
expect(r2.value.collectionType, CollectionType.Set);


final r3 = CollectionParser.listParser.parse('List<StringCharacter>?');
print(r3);

// final r3 = CollectionParser.setParser.parse("Sets<int ");
// print(r3);
// expect(r3.isSuccess, false);
Expand Down

0 comments on commit 561785e

Please sign in to comment.