@@ -48,12 +48,12 @@ abstract class RubyLexer extends JFlexSymbolMatcher
4848 private static final Pattern HERE_TERMINATOR_MATCH = Pattern .compile (
4949 "^[a-zA-Z0-9_\u0016 0-\u0255 ]+" );
5050
51- private RubyLexerData d ;
51+ private RubyLexerData dHead ;
5252
5353 private Stack <RubyLexerData > data ;
5454
5555 RubyLexer () {
56- d = new RubyLexerData ();
56+ dHead = new RubyLexerData ();
5757 }
5858
5959 /**
@@ -62,7 +62,7 @@ abstract class RubyLexer extends JFlexSymbolMatcher
6262 @ Override
6363 public void reset () {
6464 super .reset ();
65- d = new RubyLexerData ();
65+ dHead = new RubyLexerData ();
6666 if (data != null ) {
6767 data .clear ();
6868 }
@@ -79,14 +79,14 @@ public void reset() {
7979 */
8080 public boolean maybeEndQuote (String capture ) {
8181 char c = capture .charAt (0 );
82- if (c == d .endqchar ) {
83- if (--d .nendqchar <= 0 ) {
84- d .endqchar = '\0' ;
85- d .nestqchar = '\0' ;
82+ if (c == dHead .endqchar ) {
83+ if (--dHead .nendqchar <= 0 ) {
84+ dHead .endqchar = '\0' ;
85+ dHead .nestqchar = '\0' ;
8686 return true ;
8787 }
88- } else if (d .nestqchar != '\0' && c == d .nestqchar ) {
89- ++d .nendqchar ;
88+ } else if (dHead .nestqchar != '\0' && c == dHead .nestqchar ) {
89+ ++dHead .nendqchar ;
9090 }
9191 return false ;
9292 }
@@ -97,7 +97,7 @@ public boolean maybeEndQuote(String capture) {
9797 * @return true if modifiers are OK
9898 */
9999 public boolean areModifiersOK () {
100- switch (d .qopname ) {
100+ switch (dHead .qopname ) {
101101 case "m" : // named here a la Perl for the Ruby /pat/ operator
102102 return true ;
103103 default :
@@ -134,20 +134,20 @@ public void qop(boolean doWrite, String capture, int namelength,
134134 // with \b as a zero-width simple word boundary. Excise it into
135135 // `boundary'.
136136 String postop = capture ;
137- d .qopname = "" ;
137+ dHead .qopname = "" ;
138138 if (namelength > 0 ) {
139- d .qopname = capture .substring (0 , namelength );
140- postop = capture .substring (d .qopname .length ());
139+ dHead .qopname = capture .substring (0 , namelength );
140+ postop = capture .substring (dHead .qopname .length ());
141141 }
142- d .nendqchar = 1 ;
143- d .collateralCapture = null ;
142+ dHead .nendqchar = 1 ;
143+ dHead .collateralCapture = null ;
144144
145145 char opc = postop .charAt (0 );
146146 setEndQuoteChar (opc );
147147 setState (postop , nointerp );
148148
149149 if (doWrite ) {
150- offer (d .qopname );
150+ offer (dHead .qopname );
151151 skipSymbol ();
152152 disjointSpan (HtmlConsts .STRING_CLASS );
153153 offer (postop );
@@ -184,24 +184,24 @@ public void setState(String postop, boolean nointerp) {
184184 private void setEndQuoteChar (char opener ) {
185185 switch (opener ) {
186186 case '[' :
187- d .nestqchar = opener ;
188- d .endqchar = ']' ;
187+ dHead .nestqchar = opener ;
188+ dHead .endqchar = ']' ;
189189 break ;
190190 case '<' :
191- d .nestqchar = opener ;
192- d .endqchar = '>' ;
191+ dHead .nestqchar = opener ;
192+ dHead .endqchar = '>' ;
193193 break ;
194194 case '(' :
195- d .nestqchar = opener ;
196- d .endqchar = ')' ;
195+ dHead .nestqchar = opener ;
196+ dHead .endqchar = ')' ;
197197 break ;
198198 case '{' :
199- d .nestqchar = opener ;
200- d .endqchar = '}' ;
199+ dHead .nestqchar = opener ;
200+ dHead .endqchar = '}' ;
201201 break ;
202202 default :
203- d .nestqchar = '\0' ;
204- d .endqchar = opener ;
203+ dHead .nestqchar = '\0' ;
204+ dHead .endqchar = opener ;
205205 break ;
206206 }
207207 }
@@ -290,8 +290,8 @@ public void hop(String capture) throws IOException {
290290 }
291291
292292 offer (capture );
293- if (d .hereSettings == null ) {
294- d .hereSettings = new LinkedList <>();
293+ if (dHead .hereSettings == null ) {
294+ dHead .hereSettings = new LinkedList <>();
295295 }
296296
297297 String remaining = capture ;
@@ -346,7 +346,7 @@ public void hop(String capture) throws IOException {
346346 state = indented ? HEREin () : HERE ();
347347 }
348348 settings = new HereDocSettings (terminator , state );
349- d .hereSettings .add (settings );
349+ dHead .hereSettings .add (settings );
350350 }
351351
352352 /**
@@ -355,8 +355,8 @@ public void hop(String capture) throws IOException {
355355 * @return true if a Here state was pushed
356356 */
357357 public boolean maybeStartHere () throws IOException {
358- if (d .hereSettings != null && d .hereSettings .size () > 0 ) {
359- HereDocSettings settings = d .hereSettings .peek ();
358+ if (dHead .hereSettings != null && dHead .hereSettings .size () > 0 ) {
359+ HereDocSettings settings = dHead .hereSettings .peek ();
360360 yypush (settings .state );
361361 disjointSpan (HtmlConsts .STRING_CLASS );
362362 return true ;
@@ -371,20 +371,20 @@ public boolean maybeStartHere() throws IOException {
371371 */
372372 public boolean maybeEndHere (String capture ) throws IOException {
373373 String trimmed = capture .replaceFirst ("^\\ s+" , "" );
374- HereDocSettings settings = d .hereSettings .peek ();
374+ HereDocSettings settings = dHead .hereSettings .peek ();
375375 assert settings != null ;
376376
377377 boolean didZspan = false ;
378378 if (trimmed .equals (settings .terminator )) {
379379 disjointSpan (null );
380380 didZspan = true ;
381- d .hereSettings .remove ();
381+ dHead .hereSettings .remove ();
382382 }
383383
384384 offer (capture );
385385
386- if (d .hereSettings .size () > 0 ) {
387- settings = d .hereSettings .peek ();
386+ if (dHead .hereSettings .size () > 0 ) {
387+ settings = dHead .hereSettings .peek ();
388388 yybegin (settings .state );
389389 if (didZspan ) {
390390 disjointSpan (HtmlConsts .STRING_CLASS );
@@ -400,7 +400,7 @@ public boolean maybeEndHere(String capture) throws IOException {
400400 * Resets the interpolation counter to 1.
401401 */
402402 public void interpop () {
403- d .nendbrace = 1 ;
403+ dHead .nendbrace = 1 ;
404404 }
405405
406406 /**
@@ -413,11 +413,11 @@ public void interpop() {
413413 * @return true if the interpolation state should end
414414 */
415415 public boolean maybeEndInterpolation (String capture ) throws IOException {
416- if (d .nendbrace <= 0 ) {
416+ if (dHead .nendbrace <= 0 ) {
417417 return false ;
418418 }
419419 if (capture .startsWith ("}" )) {
420- if (--d .nendbrace <= 0 ) {
420+ if (--dHead .nendbrace <= 0 ) {
421421 int rem = capture .length () - 1 ;
422422 String opener = capture .substring (0 , 1 );
423423 popData ();
@@ -430,7 +430,7 @@ public boolean maybeEndInterpolation(String capture) throws IOException {
430430 return true ;
431431 }
432432 } else if (capture .startsWith ("{" )) {
433- ++d .nendbrace ;
433+ ++dHead .nendbrace ;
434434 }
435435 return false ;
436436 }
@@ -477,22 +477,22 @@ public int nameLength(String capture) {
477477 * @return a defined pattern or null
478478 */
479479 public Pattern getCollateralCapturePattern () {
480- if (d .endqchar == '\0' ) {
480+ if (dHead .endqchar == '\0' ) {
481481 return null ;
482482 }
483- if (d .collateralCapture != null ) {
484- return d .collateralCapture ;
483+ if (dHead .collateralCapture != null ) {
484+ return dHead .collateralCapture ;
485485 }
486486
487487 StringBuilder patb = new StringBuilder ("[" );
488- patb .append (Pattern .quote (String .valueOf (d .endqchar )));
489- if (d .nestqchar != '\0' ) {
490- patb .append (Pattern .quote (String .valueOf (d .nestqchar )));
488+ patb .append (Pattern .quote (String .valueOf (dHead .endqchar )));
489+ if (dHead .nestqchar != '\0' ) {
490+ patb .append (Pattern .quote (String .valueOf (dHead .nestqchar )));
491491 }
492492 patb .append ("]" );
493493 patb .append (RegexUtils .getNotFollowingEscapePattern ());
494- d .collateralCapture = Pattern .compile (patb .toString ());
495- return d .collateralCapture ;
494+ dHead .collateralCapture = Pattern .compile (patb .toString ());
495+ return dHead .collateralCapture ;
496496 }
497497
498498 /**
@@ -514,12 +514,12 @@ void pushData() {
514514 if (data == null ) {
515515 data = new Stack <>();
516516 }
517- data .push (d );
518- d = new RubyLexerData ();
517+ data .push (dHead );
518+ dHead = new RubyLexerData ();
519519 }
520520
521521 void popData () {
522- d = data .pop ();
522+ dHead = data .pop ();
523523 }
524524
525525 /**
0 commit comments