summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-01-14 10:26:03 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2022-01-14 20:07:07 -0600
commit6e67e17475004035d76f8b51c315bedd1cb2809f (patch)
tree6972fa5a406a514689fc7ac0fd24c4b3f897a0b9
parentcc67c19185ac21aecea7abf0c7e820b472e95b25 (diff)
downloadnumpy-6e67e17475004035d76f8b51c315bedd1cb2809f.tar.gz
MAINT: Remove unused/unnecessary allow-embedded-newlines option
No other parser has this option, so I think we really do not need it.
-rw-r--r--numpy/core/src/multiarray/textreading/parser_config.h10
-rw-r--r--numpy/core/src/multiarray/textreading/readtext.c1
-rw-r--r--numpy/core/src/multiarray/textreading/tokenize.c.src15
3 files changed, 1 insertions, 25 deletions
diff --git a/numpy/core/src/multiarray/textreading/parser_config.h b/numpy/core/src/multiarray/textreading/parser_config.h
index b6e7feec0..00e911667 100644
--- a/numpy/core/src/multiarray/textreading/parser_config.h
+++ b/numpy/core/src/multiarray/textreading/parser_config.h
@@ -41,16 +41,6 @@ typedef struct {
bool delimiter_is_whitespace;
/*
- * A boolean value (0 or 1). If 1, quoted fields may span
- * more than one line. For example, the following
- * 100, 200, "FOO
- * BAR"
- * is one "row", containing three fields: 100, 200 and "FOO\nBAR".
- * If 0, the parser considers an unclosed quote to be an error. (XXX Check!)
- */
- bool allow_embedded_newline;
-
- /*
* The imaginary unit character. Default is `j`.
*/
Py_UCS4 imaginary_unit;
diff --git a/numpy/core/src/multiarray/textreading/readtext.c b/numpy/core/src/multiarray/textreading/readtext.c
index 678b3be7c..c1b174c99 100644
--- a/numpy/core/src/multiarray/textreading/readtext.c
+++ b/numpy/core/src/multiarray/textreading/readtext.c
@@ -119,7 +119,6 @@ _load_from_filelike(PyObject *NPY_UNUSED(mod),
.comment = '#',
.quote = '"',
.imaginary_unit = 'j',
- .allow_embedded_newline = true,
.delimiter_is_whitespace = false,
.ignore_leading_whitespace = false,
.python_byte_converters = false,
diff --git a/numpy/core/src/multiarray/textreading/tokenize.c.src b/numpy/core/src/multiarray/textreading/tokenize.c.src
index 75d0d6733..68dd2ce93 100644
--- a/numpy/core/src/multiarray/textreading/tokenize.c.src
+++ b/numpy/core/src/multiarray/textreading/tokenize.c.src
@@ -210,20 +210,7 @@ tokenizer_core_@type@(tokenizer_state *ts, parser_config *const config)
case TOKENIZE_QUOTED:
chunk_start = pos;
for (; pos < stop; pos++) {
- if (!config->allow_embedded_newline) {
- if (*pos == '\r') {
- ts->state = TOKENIZE_EAT_CRLF;
- break;
- }
- else if (*pos == '\n') {
- ts->state = TOKENIZE_LINE_END;
- break;
- }
- }
- else if (*pos != config->quote) {
- /* inside the field, nothing to do. */
- }
- else {
+ if (*pos == config->quote) {
ts->state = TOKENIZE_QUOTED_CHECK_DOUBLE_QUOTE;
break;
}