Skip to content

Commit

Permalink
feat(#3742): add Dr- prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Dec 24, 2024
1 parent 3bf80e0 commit 57b9a5c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions eo-parser/src/main/java/org/eolang/parser/EoSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
import org.cactoos.text.Joined;
import org.cactoos.text.Split;
import org.cactoos.text.TextOf;
import org.eolang.parser.errors.EoParserErrors;
import org.eolang.parser.errors.ParsingErrors;
import org.eolang.parser.errors.DrEoParserErrors;
import org.eolang.parser.errors.DrParsingErrors;
import org.xembly.Directives;
import org.xembly.Xembler;

Expand Down Expand Up @@ -107,15 +107,15 @@ public EoSyntax(final String nme, final Input ipt) {
*/
public XML parsed() throws IOException {
final List<Text> lines = this.lines();
final ParsingErrors spy = new ParsingErrors(lines);
final DrParsingErrors spy = new DrParsingErrors(lines);
final EoLexer lexer = new EoIndentLexer(this.normalize());
lexer.removeErrorListeners();
lexer.addErrorListener(spy);
final EoParser parser = new EoParser(
new CommonTokenStream(lexer)
);
parser.removeErrorListeners();
final EoParserErrors eospy = new EoParserErrors(lines);
final DrEoParserErrors eospy = new DrEoParserErrors(lines);
parser.addErrorListener(eospy);
final XeEoListener xel = new XeEoListener(this.name);
new ParseTreeWalker().walk(xel, parser.program());
Expand Down
4 changes: 2 additions & 2 deletions eo-parser/src/main/java/org/eolang/parser/PhiSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import org.cactoos.Text;
import org.cactoos.io.InputStreamOf;
import org.eolang.parser.errors.ParsingErrors;
import org.eolang.parser.errors.DrParsingErrors;
import org.xembly.Directive;
import org.xembly.Directives;
import org.xembly.Xembler;
Expand Down Expand Up @@ -92,7 +92,7 @@ public PhiSyntax(
@Override
public XML parsed() throws IOException {
final XePhiListener xel = new XePhiListener(this.name);
final ParsingErrors spy = new ParsingErrors(this.input);
final DrParsingErrors spy = new DrParsingErrors(this.input);
final PhiLexer lexer = new PhiLexer(
CharStreams.fromStream(
new InputStreamOf(this.input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* Accumulates all parsing errors related to EO parser.
* @since 0.50
*/
public final class EoParserErrors extends BaseErrorListener implements Iterable<Directive> {
public final class DrEoParserErrors extends BaseErrorListener implements Iterable<Directive> {

/**
* Errors accumulated.
Expand All @@ -59,7 +59,7 @@ public final class EoParserErrors extends BaseErrorListener implements Iterable<
* Ctor.
* @param src The source in lines
*/
public EoParserErrors(final List<Text> src) {
public DrEoParserErrors(final List<Text> src) {
this(new ArrayList<>(0), new Lines(src));
}

Expand All @@ -68,7 +68,7 @@ public EoParserErrors(final List<Text> src) {
* @param errors Errors accumulated
* @param lines The source in lines
*/
private EoParserErrors(final List<ParsingException> errors, final Lines lines) {
private DrEoParserErrors(final List<ParsingException> errors, final Lines lines) {
this.errors = errors;
this.lines = lines;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* @since 0.30.0
*/
public final class ParsingErrors extends BaseErrorListener implements Iterable<Directive> {
public final class DrParsingErrors extends BaseErrorListener implements Iterable<Directive> {

/**
* Errors accumulated.
Expand All @@ -55,15 +55,15 @@ public final class ParsingErrors extends BaseErrorListener implements Iterable<D
* Ctor.
* @param lines The source in lines
*/
public ParsingErrors(final Text... lines) {
public DrParsingErrors(final Text... lines) {
this(new ListOf<>(lines));
}

/**
* Ctor.
* @param src The source in lines
*/
public ParsingErrors(final List<Text> src) {
public DrParsingErrors(final List<Text> src) {
this(new ArrayList<>(0), new Lines(src));
}

Expand All @@ -72,7 +72,7 @@ public ParsingErrors(final List<Text> src) {
* @param errors Errors accumulated
* @param lines The source in lines
*/
private ParsingErrors(final List<ParsingException> errors, final Lines lines) {
private DrParsingErrors(final List<ParsingException> errors, final Lines lines) {
this.errors = errors;
this.lines = lines;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* </p>
* @since 0.50
* @todo #3332:30min Add more decorators for the error message.
* For example, {@link ParsingErrors} currently contains logic related to the message formatting.
* For example, {@link DrParsingErrors} currently contains logic related to the message formatting.
* It's better to create a separate class for this purpose.
*/
final class UnderlinedMessage {
Expand Down

0 comments on commit 57b9a5c

Please sign in to comment.