Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:flutter_lints/flutter.yaml
include: package:lints/recommended.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
6 changes: 4 additions & 2 deletions lib/lexer.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: constant_identifier_names

part of 'streaming_json_parser.dart';

const String JSON_COMMA = ',';
Expand All @@ -15,7 +17,7 @@ const List<String> JSON_SYNTAX = [
JSON_LEFTBRACKET,
JSON_RIGHTBRACKET,
JSON_LEFTBRACE,
JSON_RIGHTBRACE
JSON_RIGHTBRACE,
];

const int FALSE_LEN = 'false'.length;
Expand All @@ -35,7 +37,7 @@ Map<String, dynamic> lexString(String string) {
if (c == JSON_QUOTE) {
return {
'value': jsonString,
'rest': string.substring(jsonString.length + 1)
'rest': string.substring(jsonString.length + 1),
};
} else {
jsonString += c;
Expand Down
5 changes: 4 additions & 1 deletion lib/parser.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: prefer_typing_uninitialized_variables

part of 'streaming_json_parser.dart';

List<dynamic> parseArray(List<dynamic> tokens) {
Expand Down Expand Up @@ -56,7 +58,8 @@ Map<String, dynamic> parseObject(List<dynamic> tokens) {

if (tokens[0] != JSON_COLON) {
throw Exception(
'Expected colon after key in object, got: ${tokens[0]}');
'Expected colon after key in object, got: ${tokens[0]}',
);
}

var result = parseTokens(tokens.sublist(1));
Expand Down
1 change: 1 addition & 0 deletions lib/streaming_json_parser.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ignore: unnecessary_library_name
library streaming_json_parser;

part 'lexer.dart';
Expand Down
47 changes: 2 additions & 45 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,7 @@ repository: https://github.com/Mkohm/streaming_json_parser

environment:
sdk: ">=3.3.4 <4.0.0"
flutter: ">=1.17.0"

dependencies:
flutter:
sdk: flutter

dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/to/asset-from-package
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images

# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/to/font-from-package
lints: ^3.0.0
test: ^1.31.0
2 changes: 1 addition & 1 deletion test/streaming_json_parser_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'package:streaming_json_parser/streaming_json_parser.dart';

void main() {
Expand Down