From 387fbe4eaa6a1282945f67741fcda915ac8fbe4a Mon Sep 17 00:00:00 2001 From: Nishant Bansal Date: Thu, 8 Feb 2024 22:33:07 +0530 Subject: [PATCH] Fixed grammatical errors (Issue #2493) --- src/lpython/semantics/python_ast_to_asr.cpp | 3 +-- tests/reference/asr-arrays_09-50ee586.json | 2 +- tests/reference/asr-arrays_09-50ee586.stderr | 2 +- tests/reference/asr-arrays_10-bc82d75.json | 2 +- tests/reference/asr-arrays_10-bc82d75.stderr | 2 +- tests/reference/asr-bindc_04-06bd800.json | 2 +- tests/reference/asr-bindc_04-06bd800.stderr | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index f3e24dd94e..f56c441df0 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -1520,8 +1520,7 @@ class CommonVisitor : public AST::BaseVisitor { int64_t value_int = -1; if( !ASRUtils::extract_value(ASRUtils::expr_value(value), value_int) && contains_local_variable(value) && !is_allocatable) { - throw SemanticError("Only those local variables which can be reduced to compile " - "time constant should be used in dimensions of an array.", + throw SemanticError("Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array.", value->base.loc); } if (value_int != -1) { diff --git a/tests/reference/asr-arrays_09-50ee586.json b/tests/reference/asr-arrays_09-50ee586.json index fa9b9de0df..2f86b11cfb 100644 --- a/tests/reference/asr-arrays_09-50ee586.json +++ b/tests/reference/asr-arrays_09-50ee586.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_09-50ee586.stderr", - "stderr_hash": "30bfc87e70c4b4688cf7162eec34dce8e52c959539d20ad8b79cf845", + "stderr_hash": "0169175ca66ace6110382408ed4506313e311d560e9b8c16bdd997b3", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_09-50ee586.stderr b/tests/reference/asr-arrays_09-50ee586.stderr index 58147a840d..e485f02cbb 100644 --- a/tests/reference/asr-arrays_09-50ee586.stderr +++ b/tests/reference/asr-arrays_09-50ee586.stderr @@ -1,4 +1,4 @@ -semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. +semantic error: Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array. --> tests/errors/arrays_09.py:9:12 | 9 | x: i64[p, q, r] = empty([q, p, r], dtype=int64) diff --git a/tests/reference/asr-arrays_10-bc82d75.json b/tests/reference/asr-arrays_10-bc82d75.json index 4599fd95cf..e1b3693872 100644 --- a/tests/reference/asr-arrays_10-bc82d75.json +++ b/tests/reference/asr-arrays_10-bc82d75.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_10-bc82d75.stderr", - "stderr_hash": "59e8cc91d7dae61bf60ec4d9cd23d62cdcb162e553bd64a3995fad19", + "stderr_hash": "1c45f4b45b48ceb3de4567413bff847b67df2750fcc68d6a358df096", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_10-bc82d75.stderr b/tests/reference/asr-arrays_10-bc82d75.stderr index 7935120aa7..e7b0047ea1 100644 --- a/tests/reference/asr-arrays_10-bc82d75.stderr +++ b/tests/reference/asr-arrays_10-bc82d75.stderr @@ -1,4 +1,4 @@ -semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. +semantic error: Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array. --> tests/errors/arrays_10.py:9:36 | 9 | x: i64[100, 120, 200] = empty([q, p, r], dtype=int64) diff --git a/tests/reference/asr-bindc_04-06bd800.json b/tests/reference/asr-bindc_04-06bd800.json index 4772e98aa9..7f9fcea30c 100644 --- a/tests/reference/asr-bindc_04-06bd800.json +++ b/tests/reference/asr-bindc_04-06bd800.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-bindc_04-06bd800.stderr", - "stderr_hash": "20c105d0189cd06a197a6b1dda073a58f5c8ee0104230cf187960c46", + "stderr_hash": "85d50c491c17976f21e6263e164a6ce5dbeda95dae2635f589a02d86", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_04-06bd800.stderr b/tests/reference/asr-bindc_04-06bd800.stderr index 1a05ab5e55..a84e785818 100644 --- a/tests/reference/asr-bindc_04-06bd800.stderr +++ b/tests/reference/asr-bindc_04-06bd800.stderr @@ -1,4 +1,4 @@ -semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. +semantic error: Only those local variables that can be reduced to compile-time constants should be used in dimensions of an array. --> tests/errors/bindc_04.py:20:12 | 20 | C: i16[nk] = empty(nk, dtype=int16)