-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add name problems to DelimitedReader
- Loading branch information
1 parent
b2a0226
commit d627378
Showing
26 changed files
with
111 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
std-bits/table/src/main/java/org/enso/table/parsing/problems/AdditionalInvalidRows.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package org.enso.table.parsing.problems; | ||
|
||
import org.enso.table.problems.Problem; | ||
|
||
/** A problem which indicates how many additional invalid rows were encountered. */ | ||
public record AdditionalInvalidRows(long count) implements ParsingProblem {} | ||
public record AdditionalInvalidRows(long count) implements Problem {} |
4 changes: 3 additions & 1 deletion
4
std-bits/table/src/main/java/org/enso/table/parsing/problems/InvalidFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package org.enso.table.parsing.problems; | ||
|
||
import org.enso.table.problems.Problem; | ||
|
||
import java.util.List; | ||
|
||
/** Indicates that a text value did not match the format expected of a datatype. */ | ||
public record InvalidFormat(String column, List<String> cells) implements ParsingProblem {} | ||
public record InvalidFormat(String column, List<String> cells) implements Problem {} |
4 changes: 3 additions & 1 deletion
4
std-bits/table/src/main/java/org/enso/table/parsing/problems/InvalidRow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package org.enso.table.parsing.problems; | ||
|
||
import org.enso.table.problems.Problem; | ||
|
||
/** A problem indicating that a row contained more or less columns than expected. */ | ||
public record InvalidRow(long source_row, Long table_index, String[] row) implements ParsingProblem {} | ||
public record InvalidRow(long source_row, Long table_index, String[] row) implements Problem {} |
4 changes: 3 additions & 1 deletion
4
std-bits/table/src/main/java/org/enso/table/parsing/problems/LeadingZeros.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package org.enso.table.parsing.problems; | ||
|
||
import org.enso.table.problems.Problem; | ||
|
||
import java.util.List; | ||
|
||
/** Indicates that some values contained leading zeros when leading zeros where not allowed in the given numeric conversion. */ | ||
public record LeadingZeros(String column, List<String> cells) implements ParsingProblem {} | ||
public record LeadingZeros(String column, List<String> cells) implements Problem {} |
4 changes: 3 additions & 1 deletion
4
std-bits/table/src/main/java/org/enso/table/parsing/problems/MismatchedQuote.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package org.enso.table.parsing.problems; | ||
|
||
import org.enso.table.problems.Problem; | ||
|
||
/** A problem indicating that a quote has been opened and never closed. */ | ||
public record MismatchedQuote() implements ParsingProblem {} | ||
public record MismatchedQuote() implements Problem {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...able/parsing/problems/ParsingProblem.java → ...java/org/enso/table/problems/Problem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package org.enso.table.parsing.problems; | ||
package org.enso.table.problems; | ||
|
||
/** | ||
* A parent class for parsing problems which may be reported as warnings or errors, depending on the | ||
* setup. | ||
*/ | ||
public interface ParsingProblem {} | ||
public interface Problem {} |
6 changes: 6 additions & 0 deletions
6
std-bits/table/src/main/java/org/enso/table/problems/WithProblems.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.enso.table.problems; | ||
|
||
import java.util.List; | ||
|
||
/** A value annotated with problems that occurred when it was being computed. */ | ||
public record WithProblems<T>(T value, List<Problem> problems) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
std-bits/table/src/main/java/org/enso/table/read/ParsingFailedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package org.enso.table.read; | ||
|
||
import org.enso.table.parsing.problems.ParsingProblem; | ||
import org.enso.table.problems.Problem; | ||
|
||
/** | ||
* An exception thrown when a problem occured during parsing and the parser is running in a mode | ||
* that does not try recovering, so the parsing is stopped. | ||
*/ | ||
public class ParsingFailedException extends RuntimeException { | ||
public final ParsingProblem problem; | ||
public final Problem problem; | ||
|
||
public ParsingFailedException(ParsingProblem problem) { | ||
public ParsingFailedException(Problem problem) { | ||
this.problem = problem; | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
std-bits/table/src/main/java/org/enso/table/read/WithProblems.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.