From db5e58b308c81e81ce393f60f8db9e8981530470 Mon Sep 17 00:00:00 2001 From: Bart Debersaques Date: Fri, 23 Jan 2026 22:56:44 +0100 Subject: [PATCH] proposal to solve "Island Parsing - Error when Case-Insensitive" see https://github.com/kursjan/petitparser2/issues/66 --- PetitParser2-Tests/PP2SeaParserTest.class.st | 14 ++++++++++++++ PetitParser2/PP2NextSetsVisitor.class.st | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/PetitParser2-Tests/PP2SeaParserTest.class.st b/PetitParser2-Tests/PP2SeaParserTest.class.st index c4c1d38e..661a16b9 100644 --- a/PetitParser2-Tests/PP2SeaParserTest.class.st +++ b/PetitParser2-Tests/PP2SeaParserTest.class.st @@ -29,6 +29,20 @@ PP2SeaParserTest >> seaInstance [ ^ PP2SeaNode new ] +{ #category : #tests } +PP2SeaParserTest >> testCaseInsensitiveSea [ + | sea parser | + + sea := self seaInstance island: 'ISLAND' asPParser caseInsensitive. + parser := sea. + + self assert: parser parse: 'SEA island SEA'. + self assert: self result size equals: 3. + + self assert: parser fail: 'SEA nothin here SEA'. + +] + { #category : #tests } PP2SeaParserTest >> testNestedBlockDeepNested [ | block | diff --git a/PetitParser2/PP2NextSetsVisitor.class.st b/PetitParser2/PP2NextSetsVisitor.class.st index 68f34ce6..f58d9703 100644 --- a/PetitParser2/PP2NextSetsVisitor.class.st +++ b/PetitParser2/PP2NextSetsVisitor.class.st @@ -6,7 +6,7 @@ Class { 'nextSets', 'currentNext' ], - #category : 'PetitParser2-Analysis' + #category : #'PetitParser2-Analysis' } { #category : #accessing } @@ -172,7 +172,8 @@ PP2NextSetsVisitor >> visitOptional: node [ { #category : #visiting } PP2NextSetsVisitor >> visitPP2Node: node [ - self error: 'should provide specific implementation' + "self error: 'should provide specific implementation'" + self visitDelegate: node ] { #category : #visiting }