Skip to content

Commit

Permalink
Fix generated lexers of php.editor automatically via ant task
Browse files Browse the repository at this point in the history
- Comment out or remove unused code
- Remove trailing spaces
  • Loading branch information
junichi11 committed Sep 7, 2018
1 parent 80c5290 commit 1bd4e51
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions php/php.editor/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,57 @@
<jflex file="tools/Php5ColoringScanner.flex"
destdir="src"
skel="tools/skeleton.netbeans"/>
<replace file="src/org/netbeans/modules/php/editor/lexer/PHP5ColoringLexer.java">
<replacetoken> yychar+= zzMarkedPosL-zzStartRead;&#xA;&#xA;</replacetoken>
<replacevalue></replacevalue>
</replace>
<replace file="src/org/netbeans/modules/php/editor/lexer/PHP5ColoringLexer.java">
<replacetoken><![CDATA[
if (zzCurrentPosL < zzEndReadL)
zzInput = zzBufferL[zzCurrentPosL++];
else if (zzAtEOF) {
zzInput = YYEOF;
break zzForAction;
}
else {
// store back cached positions
zzCurrentPos = zzCurrentPosL;
zzMarkedPos = zzMarkedPosL;
boolean eof = zzRefill();
// get translated positions and possibly new buffer
zzCurrentPosL = zzCurrentPos;
zzMarkedPosL = zzMarkedPos;
zzBufferL = zzBuffer;
zzEndReadL = zzEndRead;
if (eof) {
zzInput = YYEOF;
break zzForAction;
}
else {
zzInput = zzBufferL[zzCurrentPosL++];
}
}]]></replacetoken>
<replacevalue></replacevalue>
</replace>
<replaceregexp file="src/org/netbeans/modules/php/editor/lexer/PHP5ColoringLexer.java"
match="[ ]+$"
replace=""
byline="true" />
</target-->

<!-- for ast scanner, jflex 1.4 must be used! -->
<!--target name="gen-astscanner">
<jflex file="tools/ASTPHP5Scanner.flex"
destdir="src"
skel="tools/skeletonParser.netbeans"/>
<replace file="src/org/netbeans/modules/php/editor/parser/ASTPHP5Scanner.java">
<replacetoken>if (!zzEOFDone) {&#xA; zzEOFDone = true;&#xA; yyclose();&#xA; }</replacetoken>
<replacevalue>/*if (!zzEOFDone) {&#xA; zzEOFDone = true;&#xA; yyclose();&#xA; }*/</replacevalue>
</replace>
<replaceregexp file="src/org/netbeans/modules/php/editor/parser/ASTPHP5Scanner.java"
match="[ ]+$"
replace=""
byline="true" />
</target-->

<!--target name="gen-docscanner">
Expand Down

0 comments on commit 1bd4e51

Please sign in to comment.