Added regression test for antlr/antlr4#2709
This commit is contained in:
parent
6149033601
commit
a057ebbd2e
|
@ -1057,4 +1057,33 @@ public class LexerExecDescriptors {
|
||||||
return new Pair<>(grammarName, grammar);
|
return new Pair<>(grammarName, grammar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a regression test for antlr/antlr4#2709 "PHP target generates
|
||||||
|
* invalid output when $ is used as part of the literal in lexer rule"
|
||||||
|
* https://github.com/antlr/antlr4/issues/2709
|
||||||
|
*/
|
||||||
|
public static class EscapeTargetStringLiteral extends BaseLexerTestDescriptor {
|
||||||
|
/**
|
||||||
|
[@0,0:-1='<EOF>',<-1>,1:0]
|
||||||
|
*/
|
||||||
|
@CommentHasStringValue
|
||||||
|
public String output;
|
||||||
|
|
||||||
|
public String errors = null;
|
||||||
|
public String startRule = "";
|
||||||
|
public String grammarName = "L";
|
||||||
|
|
||||||
|
/**
|
||||||
|
lexer grammar L;
|
||||||
|
ACTION_WITH_DOLLAR: '$ACTION';
|
||||||
|
*/
|
||||||
|
@CommentHasStringValue
|
||||||
|
public String grammar;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean ignore(String targetName) {
|
||||||
|
return !targetName.equals("PHP");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue