File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Sources/_StringProcessing Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,16 @@ extension PrettyPrinter {
119119 printer. printAsPattern ( convertedFromAST: child)
120120 }
121121
122+ case . lookahead:
123+ printBlock ( " Lookahead " ) { printer in
124+ printer. printAsPattern ( convertedFromAST: child)
125+ }
126+
127+ case . negativeLookahead:
128+ printBlock ( " NegativeLookahead " ) { printer in
129+ printer. printAsPattern ( convertedFromAST: child)
130+ }
131+
122132 default :
123133 printAsPattern ( convertedFromAST: child)
124134 }
Original file line number Diff line number Diff line change @@ -98,6 +98,32 @@ extension RenderDSLTests {
9898 /$/
9999 }
100100 """# )
101+
102+ try testConversion ( #"foo(?=bar)"# , #"""
103+ Regex {
104+ "foo"
105+ Lookahead {
106+ "bar"
107+ }
108+ }
109+ """# )
110+
111+ try testConversion ( #"abc(?=def(?!ghi)|xyz)"# , #"""
112+ Regex {
113+ "abc"
114+ Lookahead {
115+ ChoiceOf {
116+ Regex {
117+ "def"
118+ NegativeLookahead {
119+ "ghi"
120+ }
121+ }
122+ "xyz"
123+ }
124+ }
125+ }
126+ """# )
101127 }
102128
103129 func testOptions( ) throws {
You can’t perform that action at this time.
0 commit comments