From db697ae1d56782803b0e932e8aca880a1465438f Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 12 Mar 2023 17:08:08 +0100 Subject: [PATCH 1/7] Update to latest PetitParser 6.0.0 --- lib/src/xml/utils/character_data_parser.dart | 22 ++++++-------- .../xml_events/converters/event_decoder.dart | 26 ++++++++-------- lib/src/xml_events/iterator.dart | 30 +++++++++---------- lib/src/xml_events/parser.dart | 4 +-- pubspec.yaml | 5 ++++ test/entity_test.dart | 23 +++++--------- 6 files changed, 52 insertions(+), 58 deletions(-) diff --git a/lib/src/xml/utils/character_data_parser.dart b/lib/src/xml/utils/character_data_parser.dart index c9d948bc..dfbf7f2a 100644 --- a/lib/src/xml/utils/character_data_parser.dart +++ b/lib/src/xml/utils/character_data_parser.dart @@ -10,25 +10,21 @@ class XmlCharacterDataParser extends Parser { final int _minLength; @override - Result parseOn(Context context) { + void parseOn(Context context) { final buffer = context.buffer; final position = context.position; final index = position < buffer.length ? buffer.indexOf(_stopper, position) : buffer.length; final end = index == -1 ? buffer.length : index; - return end - position < _minLength - ? context.failure('Unable to parse character data.') - : context.success(buffer.substring(position, end), end); - } - - @override - int fastParseOn(String buffer, int position) { - final index = position < buffer.length - ? buffer.indexOf(_stopper, position) - : buffer.length; - final end = index == -1 ? buffer.length : index; - return end - position < _minLength ? -1 : end; + if (end - position < _minLength) { + context.isSuccess = false; + context.message = 'Unable to parse character data.'; + } else { + context.isSuccess = true; + context.position = end; + context.value = buffer.substring(position, end); + } } @override diff --git a/lib/src/xml_events/converters/event_decoder.dart b/lib/src/xml_events/converters/event_decoder.dart index b9df0c4f..38984ef3 100644 --- a/lib/src/xml_events/converters/event_decoder.dart +++ b/lib/src/xml_events/converters/event_decoder.dart @@ -89,22 +89,23 @@ class _XmlEventDecoderSink extends StringConversionSinkBase { return; } final result = []; - Result previous = - Failure(carry + str.substring(start, end), 0, ''); + final context = carry.isEmpty + ? Context(str, start: start, end: end) + : Context(carry + str.substring(start, end)); for (;;) { - final current = eventParser.parseOn(previous); - if (current.isSuccess) { - final event = current.value; + final position = context.position; + eventParser.parseOn(context); + if (context.isSuccess) { + final event = context.value as XmlEvent; annotator.annotate( event, - start: offset + previous.position, - stop: offset + current.position, + start: offset + position, + stop: offset + context.position, ); result.add(event); - previous = current; } else { - carry = previous.buffer.substring(previous.position); - offset += previous.position; + carry = context.buffer.substring(position, context.end); + offset += position; break; } } @@ -119,8 +120,9 @@ class _XmlEventDecoderSink extends StringConversionSinkBase { @override void close() { if (carry.isNotEmpty) { - final context = eventParser.parseOn(Failure(carry, 0, '')); - if (context.isFailure) { + final context = Context(carry); + eventParser.parseOn(context); + if (!context.isSuccess) { throw XmlParserException(context.message, position: offset + context.position); } diff --git a/lib/src/xml_events/iterator.dart b/lib/src/xml_events/iterator.dart index 69294c63..4074cb99 100644 --- a/lib/src/xml_events/iterator.dart +++ b/lib/src/xml_events/iterator.dart @@ -1,4 +1,4 @@ -import 'package:petitparser/petitparser.dart' show Parser, Result, Failure; +import 'package:petitparser/petitparser.dart' show Parser, Context; import '../xml/entities/entity_mapping.dart'; import '../xml/exceptions/parser_exception.dart'; @@ -10,12 +10,12 @@ class XmlEventIterator extends Iterator { XmlEventIterator( String input, XmlEntityMapping entityMapping, this._annotator) : _eventParser = eventParserCache[entityMapping], - _context = Failure(input, 0, ''); + _context = Context(input); final Parser _eventParser; final XmlAnnotator _annotator; - Result? _context; + Context? _context; XmlEvent? _current; @override @@ -25,25 +25,25 @@ class XmlEventIterator extends Iterator { bool moveNext() { final context = _context; if (context != null) { - final result = _eventParser.parseOn(context); - if (result.isSuccess) { - _context = result; - _current = result.value; + final position = context.position; + _eventParser.parseOn(context); + if (context.isSuccess) { _annotator.annotate( - result.value, + _current = context.value as XmlEvent, buffer: context.buffer, - start: context.position, - stop: result.position, + start: position, + stop: context.position, ); return true; - } else if (context.position < context.buffer.length) { + } else if (position < context.end) { // In case of an error, skip one character and throw an exception. - _context = context.failure(result.message, context.position + 1); - throw XmlParserException(result.message, - buffer: result.buffer, position: result.position); + final errorPosition = context.position; + context.position = position + 1; + throw XmlParserException(context.message, + buffer: context.buffer, position: errorPosition); } else { // In case of reaching the end, terminate the iterator. - _context = null; + _context = _current = null; _annotator.close( buffer: context.buffer, position: context.position, diff --git a/lib/src/xml_events/parser.dart b/lib/src/xml_events/parser.dart index aba09d47..d4a95c97 100644 --- a/lib/src/xml_events/parser.dart +++ b/lib/src/xml_events/parser.dart @@ -33,7 +33,7 @@ class XmlEventParser { ref0(declaration), ref0(processing), ref0(doctype), - ].toChoiceParser(failureJoiner: selectFarthest); + ].toChoiceParser(strategy: ChoiceStrategy.farthestFailure); // Events @@ -49,7 +49,7 @@ class XmlEventParser { [ XmlToken.closeElement.toParser(), XmlToken.closeEndElement.toParser(), - ].toChoiceParser(failureJoiner: selectFirst), + ].toChoiceParser(strategy: ChoiceStrategy.firstFailure), ).map5((_, nameToken, attributes, __, closeElement) => XmlStartElementEvent( nameToken, attributes, closeElement == XmlToken.closeEndElement)); diff --git a/pubspec.yaml b/pubspec.yaml index 85b20ac2..1aa8205d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,3 +14,8 @@ dev_dependencies: args: ^2.4.0 lints: ^2.0.0 test: ^1.23.0 +dependency_overrides: + petitparser: + git: + url: https://github.com/petitparser/dart-petitparser.git + ref: mutable-context diff --git a/test/entity_test.dart b/test/entity_test.dart index 4424213a..f03cb3a3 100644 --- a/test/entity_test.dart +++ b/test/entity_test.dart @@ -1,3 +1,4 @@ +import 'package:petitparser/matcher.dart'; import 'package:test/test.dart'; import 'package:xml/src/xml/utils/character_data_parser.dart'; import 'package:xml/xml.dart'; @@ -254,24 +255,14 @@ void main() { expect(result3.value, 'ab'); }); test('fast parse without stopper', () { - final result1 = parser.fastParseOn('', 0); - expect(result1, -1); - - final result2 = parser.fastParseOn('a', 0); - expect(result2, 1); - - final result3 = parser.fastParseOn('ab', 0); - expect(result3, 2); + expect(parser.accept(''), isFalse); + expect(parser.accept('a'), isTrue); + expect(parser.accept('ab'), isTrue); }); test('fast parse with stopper', () { - final result1 = parser.fastParseOn('*', 0); - expect(result1, -1); - - final result2 = parser.fastParseOn('a*', 0); - expect(result2, 1); - - final result3 = parser.fastParseOn('ab*', 0); - expect(result3, 2); + expect(parser.accept('*'), isFalse); + expect(parser.accept('a*'), isTrue); + expect(parser.accept('ab*'), isTrue); }); test('copy and equality', () { expect(parser.isEqualTo(parser), isTrue); From 23dea30515fd80708c927665adb855fbf11d1d54 Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 2 Apr 2023 12:12:33 +0200 Subject: [PATCH 2/7] Add `XmlElement.tag` constructor that greatly simplifies the creation of elements, i.e. `XmlElement(XmlName('br'), [], [], true)` becomes `XmlElement.tag('br', isSelfClosing: true)`. --- CHANGELOG.md | 2 +- lib/src/xml/builder.dart | 4 +- lib/src/xml/nodes/element.dart | 25 ++++++--- lib/src/xml/visitors/transformer.dart | 4 +- .../xml_events/converters/node_decoder.dart | 12 ++--- pubspec.yaml | 2 +- test/node_test.dart | 4 +- test/visitor_test.dart | 54 +++++++++---------- 8 files changed, 57 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4684c7..3baf5477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 7.0.0 (Unpublished) -* Change the `XmlElement` constructor from positional to named parameters. This yields much more readable code, for example `XmlElement(XmlName('br'), [], [], true)` becomes `XmlElement(XmlName('br'), isSelfClosing: true)`. +* Add `XmlElement.tag` constructor that greatly simplifies the creation of elements, i.e. `XmlElement(XmlName('br'), [], [], true)` becomes `XmlElement.tag('br', isSelfClosing: true)`. * Deprecate the ambiguous `XmlNode.text`: Replace with `XmlNode.value` to access the textual contents of the node, or `XmlNode.innerText` to access the textual contents of its descendants. * Fix `XmlNode.siblings` and various related methods to also work correctly on `XmlAttribute` nodes, make the method return a mutable list. * Improve `XmlNode.replace(XmlNode)` and add `XmlNode.remove()` for easy removal of a node. diff --git a/lib/src/xml/builder.dart b/lib/src/xml/builder.dart index 0817f7b5..2e569135 100644 --- a/lib/src/xml/builder.dart +++ b/lib/src/xml/builder.dart @@ -371,8 +371,8 @@ class NodeBuilder { late final XmlName name; - XmlElement buildElement() => XmlElement(name, - attributes: attributes, children: children, isSelfClosing: isSelfClosing); + XmlElement buildElement() => + XmlElement(name, attributes, children, isSelfClosing); XmlDocument buildDocument() => XmlDocument(children); diff --git a/lib/src/xml/nodes/element.dart b/lib/src/xml/nodes/element.dart index fe7aeb2a..4b5f03a6 100644 --- a/lib/src/xml/nodes/element.dart +++ b/lib/src/xml/nodes/element.dart @@ -15,14 +15,14 @@ class XmlElement extends XmlNode XmlHasParent, XmlHasAttributes, XmlHasChildren { - /// Create an element node with the provided [name], [attributes], and + /// Creates an element node with the provided [name], [attributes], and /// [children]. XmlElement( - this.name, { + this.name, [ Iterable attributes = const [], Iterable children = const [], this.isSelfClosing = true, - }) { + ]) { name.attachParent(this); this.attributes.initialize(this, attributeNodeTypes); this.attributes.addAll(attributes); @@ -30,6 +30,16 @@ class XmlElement extends XmlNode this.children.addAll(children); } + /// Creates an element with the qualified [name], and with optional + /// [attributes] and [children]. + XmlElement.tag( + String qualifiedName, { + Iterable attributes = const [], + Iterable children = const [], + bool isSelfClosing = true, + }) : this(XmlName.fromString(qualifiedName), attributes, children, + isSelfClosing); + /// Defines whether the element should be self-closing when empty. bool isSelfClosing; @@ -40,10 +50,11 @@ class XmlElement extends XmlNode XmlNodeType get nodeType => XmlNodeType.ELEMENT; @override - XmlElement copy() => XmlElement(name.copy(), - attributes: attributes.map((each) => each.copy()), - children: children.map((each) => each.copy()), - isSelfClosing: isSelfClosing); + XmlElement copy() => XmlElement( + name.copy(), + attributes.map((each) => each.copy()), + children.map((each) => each.copy()), + isSelfClosing); @override void accept(XmlVisitor visitor) => visitor.visitElement(this); diff --git a/lib/src/xml/visitors/transformer.dart b/lib/src/xml/visitors/transformer.dart index 3b8f957e..e7a9b657 100644 --- a/lib/src/xml/visitors/transformer.dart +++ b/lib/src/xml/visitors/transformer.dart @@ -68,9 +68,7 @@ class XmlTransformer { XmlDocumentFragment(node.children.map(visit)); XmlElement visitElement(XmlElement node) => XmlElement(visit(node.name), - attributes: node.attributes.map(visit), - children: node.children.map(visit), - isSelfClosing: node.isSelfClosing); + node.attributes.map(visit), node.children.map(visit), node.isSelfClosing); XmlName visitName(XmlName name) => XmlName.fromString(name.qualified); diff --git a/lib/src/xml_events/converters/node_decoder.dart b/lib/src/xml_events/converters/node_decoder.dart index 244648be..930a900e 100644 --- a/lib/src/xml_events/converters/node_decoder.dart +++ b/lib/src/xml_events/converters/node_decoder.dart @@ -104,10 +104,8 @@ class _XmlNodeDecoderSink extends ChunkedConversionSink> @override void visitStartElementEvent(XmlStartElementEvent event) { - final element = XmlElement( - XmlName.fromString(event.name), - attributes: convertAttributes(event.attributes), - ); + final element = XmlElement.tag(event.name, + attributes: convertAttributes(event.attributes)); if (event.isSelfClosing) { commit(element, event); } else { @@ -140,9 +138,9 @@ class _XmlNodeDecoderSink extends ChunkedConversionSink> outerEvent = outerEvent.parent) { outerElement = XmlElement( XmlName.fromString(outerEvent.name), - attributes: convertAttributes(outerEvent.attributes), - children: [outerElement], - isSelfClosing: outerEvent.isSelfClosing, + convertAttributes(outerEvent.attributes), + [outerElement], + outerEvent.isSelfClosing, ); } sink.add([node]); diff --git a/pubspec.yaml b/pubspec.yaml index 1aa8205d..238a289d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: dev_dependencies: args: ^2.4.0 lints: ^2.0.0 - test: ^1.23.0 + test: ^1.24.0 dependency_overrides: petitparser: git: diff --git a/test/node_test.dart b/test/node_test.dart index a684f55d..8aeec265 100644 --- a/test/node_test.dart +++ b/test/node_test.dart @@ -97,9 +97,9 @@ void main() { XmlDocument.parse('text'); final node = document.rootElement; expect(() => XmlElement(node.name), throwsA(isXmlParentException())); - expect(() => XmlElement(XmlName('data'), attributes: node.attributes), + expect(() => XmlElement.tag('data', attributes: node.attributes), throwsA(isXmlParentException())); - expect(() => XmlElement(XmlName('data'), children: node.children), + expect(() => XmlElement.tag('data', children: node.children), throwsA(isXmlParentException())); }); test('add attribute', () { diff --git a/test/visitor_test.dart b/test/visitor_test.dart index 78dfb904..55eaf3ce 100644 --- a/test/visitor_test.dart +++ b/test/visitor_test.dart @@ -4,7 +4,7 @@ import 'package:xml/xml.dart'; void main() { group('normalizer', () { test('remove empty text', () { - final element = XmlElement(XmlName('element'), children: [ + final element = XmlElement.tag('element', children: [ XmlText(''), XmlElement(XmlName('element1')), XmlText(''), @@ -17,7 +17,7 @@ void main() { element.toXmlString(), ''); }); test('join adjacent text', () { - final element = XmlElement(XmlName('element'), children: [ + final element = XmlElement.tag('element', children: [ XmlText('aaa'), XmlText('bbb'), XmlText('ccc'), @@ -27,7 +27,7 @@ void main() { expect(element.toXmlString(), 'aaabbbccc'); }); test('trim whitespace', () { - final element = XmlElement(XmlName('element'), children: [ + final element = XmlElement.tag('element', children: [ XmlText(' a '), XmlText(' b '), ]); @@ -36,15 +36,15 @@ void main() { expect(element.toXmlString(), 'a b'); }); test('selectively trim whitespace', () { - final element = XmlElement(XmlName('element'), children: [ - XmlElement(XmlName('a'), children: [XmlText(' 1 ')]), - XmlElement(XmlName('b'), children: [XmlText(' 2 ')]), + final element = XmlElement.tag('element', children: [ + XmlElement.tag('a', children: [XmlText(' 1 ')]), + XmlElement.tag('b', children: [XmlText(' 2 ')]), ]); element.normalize(trimWhitespace: (node) => node.value == ' 2 '); expect(element.toXmlString(), ' 1 2'); }); test('collapse whitespace', () { - final element = XmlElement(XmlName('element'), children: [ + final element = XmlElement.tag('element', children: [ XmlText(' a '), XmlText(' b '), ]); @@ -53,32 +53,32 @@ void main() { expect(element.toXmlString(), ' a b '); }); test('selectively collapse whitespace', () { - final element = XmlElement(XmlName('element'), children: [ - XmlElement(XmlName('a'), children: [XmlText('1 1')]), - XmlElement(XmlName('b'), children: [XmlText('2 2')]), + final element = XmlElement.tag('element', children: [ + XmlElement.tag('a', children: [XmlText('1 1')]), + XmlElement.tag('b', children: [XmlText('2 2')]), ]); element.normalize(collapseWhitespace: (node) => node.value == '2 2'); expect(element.toXmlString(), '1 12 2'); }); test('normalize newlines', () { - final element = XmlElement(XmlName('element'), children: [ - XmlElement(XmlName('xD'), children: [XmlText('\r')]), - XmlElement(XmlName('xD-xA'), children: [XmlText('\r\n')]), - XmlElement(XmlName('xD-x85'), children: [XmlText('\r\u0085')]), - XmlElement(XmlName('x85'), children: [XmlText('\u0085')]), - XmlElement(XmlName('x2028'), children: [XmlText('\u2028')]), + final element = XmlElement.tag('element', children: [ + XmlElement.tag('xD', children: [XmlText('\r')]), + XmlElement.tag('xD-xA', children: [XmlText('\r\n')]), + XmlElement.tag('xD-x85', children: [XmlText('\r\u0085')]), + XmlElement.tag('x85', children: [XmlText('\u0085')]), + XmlElement.tag('x2028', children: [XmlText('\u2028')]), ]); element.normalize(normalizeAllNewline: true); expect( element.children.map((child) => child.innerText), everyElement('\n')); }); test('selectively normalize newlines', () { - final element = XmlElement(XmlName('element'), children: [ - XmlElement(XmlName('xD'), children: [XmlText('\r')]), - XmlElement(XmlName('xD-xA'), children: [XmlText('\r\n')]), - XmlElement(XmlName('xD-x85'), children: [XmlText('\r\u0085')]), - XmlElement(XmlName('x85'), children: [XmlText('\u0085')]), - XmlElement(XmlName('x2028'), children: [XmlText('\u2028')]), + final element = XmlElement.tag('element', children: [ + XmlElement.tag('xD', children: [XmlText('\r')]), + XmlElement.tag('xD-xA', children: [XmlText('\r\n')]), + XmlElement.tag('xD-x85', children: [XmlText('\r\u0085')]), + XmlElement.tag('x85', children: [XmlText('\u0085')]), + XmlElement.tag('x2028', children: [XmlText('\u2028')]), ]); element.normalize(normalizeNewline: (node) => node.value.length > 1); expect(element.children.map((child) => child.innerText), @@ -190,7 +190,7 @@ void main() { }); test('normalize text', () { final input = XmlDocument([ - XmlElement(XmlName.fromString('contents'), children: [ + XmlElement.tag('contents', children: [ XmlText(' Hello '), XmlText(' '), XmlText(' World '), @@ -337,12 +337,12 @@ void main() { ''); }); test('insert space before self-closing', () { - final element = XmlElement( - XmlName('base'), + final element = XmlElement.tag( + 'base', children: [ XmlElement(XmlName('simple')), - XmlElement( - XmlName('with-attributes'), + XmlElement.tag( + 'with-attributes', attributes: [XmlAttribute(XmlName('attr'), 'val')], ), XmlElement(XmlName('do-not-add')), From a99ead4f09201a49a1127ec086b1aab70aa59f6b Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 2 Apr 2023 12:25:58 +0200 Subject: [PATCH 3/7] Fix the parsing code --- lib/src/xml/utils/character_data_parser.dart | 12 ++++++++---- lib/src/xml_events/parser.dart | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/src/xml/utils/character_data_parser.dart b/lib/src/xml/utils/character_data_parser.dart index dfbf7f2a..1c4a71df 100644 --- a/lib/src/xml/utils/character_data_parser.dart +++ b/lib/src/xml/utils/character_data_parser.dart @@ -13,13 +13,17 @@ class XmlCharacterDataParser extends Parser { void parseOn(Context context) { final buffer = context.buffer; final position = context.position; - final index = position < buffer.length + final index = position < context.end ? buffer.indexOf(_stopper, position) - : buffer.length; - final end = index == -1 ? buffer.length : index; + : context.end; + final end = index == -1 + ? context.end + : index > context.end + ? context.end + : index; if (end - position < _minLength) { context.isSuccess = false; - context.message = 'Unable to parse character data.'; + context.message = 'Unable to parse character data'; } else { context.isSuccess = true; context.position = end; diff --git a/lib/src/xml_events/parser.dart b/lib/src/xml_events/parser.dart index d4a95c97..dbea45dc 100644 --- a/lib/src/xml_events/parser.dart +++ b/lib/src/xml_events/parser.dart @@ -241,10 +241,10 @@ class XmlEventParser { // Tokens - Parser space() => whitespace().plus().flatten('whitespace expected'); + Parser space() => whitespace().plusString('whitespace expected'); Parser spaceOptional() => - whitespace().star().flatten('whitespace expected'); + whitespace().starString('whitespace expected'); Parser nameToken() => seq2(ref0(nameStartChar), ref0(nameChar).star()).flatten('name expected'); From 0d24d02d11279ecabdca7297adb2c8e788c9e8cf Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 2 Apr 2023 12:47:38 +0200 Subject: [PATCH 4/7] Update to PetitParser 6.0.0, which brings speed improvements of up to 15% when parsing XML files. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3baf5477..140cb6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Improve `XmlNode.replace(XmlNode)` and add `XmlNode.remove()` for easy removal of a node. * Improve error position propagation when building an XML DOM. * Make the parser more forgiving when reading attributes. +* Update to PetitParser 6.0.0, which brings speed improvements of up to 15% when parsing XML files. * Experimental support of a subset of XPath. * Add new-line normalization support. From a847e15a75462bf4e5f3f0ebf591661020fceced Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 2 Apr 2023 12:49:06 +0200 Subject: [PATCH 5/7] Merge into main branch --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 140cb6dc..e3df4f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,14 @@ # Changelog -## 7.0.0 (Unpublished) +## 7.0.0 +* Update to PetitParser 6.0.0, which brings speed improvements of up to 15% when reading large files. * Add `XmlElement.tag` constructor that greatly simplifies the creation of elements, i.e. `XmlElement(XmlName('br'), [], [], true)` becomes `XmlElement.tag('br', isSelfClosing: true)`. * Deprecate the ambiguous `XmlNode.text`: Replace with `XmlNode.value` to access the textual contents of the node, or `XmlNode.innerText` to access the textual contents of its descendants. * Fix `XmlNode.siblings` and various related methods to also work correctly on `XmlAttribute` nodes, make the method return a mutable list. * Improve `XmlNode.replace(XmlNode)` and add `XmlNode.remove()` for easy removal of a node. * Improve error position propagation when building an XML DOM. * Make the parser more forgiving when reading attributes. -* Update to PetitParser 6.0.0, which brings speed improvements of up to 15% when parsing XML files. * Experimental support of a subset of XPath. * Add new-line normalization support. From ece414fca71c60c472e72edb9613a5e3e483a172 Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 2 Apr 2023 14:31:53 +0200 Subject: [PATCH 6/7] Update pubspec.yaml --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 238a289d..7fa3564a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,7 +9,7 @@ environment: dependencies: collection: ^1.17.0 meta: ^1.9.0 - petitparser: ^5.3.0 + petitparser: ^6.0.0 dev_dependencies: args: ^2.4.0 lints: ^2.0.0 @@ -18,4 +18,4 @@ dependency_overrides: petitparser: git: url: https://github.com/petitparser/dart-petitparser.git - ref: mutable-context + ref: main From f9edd5093817feaaae4112a193189236aa7efc9b Mon Sep 17 00:00:00 2001 From: Lukas Renggli Date: Sun, 23 Apr 2023 14:11:47 +0200 Subject: [PATCH 7/7] Create a mutable-context branch. --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7fa3564a..202c1bcc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,4 +18,4 @@ dependency_overrides: petitparser: git: url: https://github.com/petitparser/dart-petitparser.git - ref: main + ref: mutable-context