Skip to content

Commit d111d2a

Browse files
authored
Merge pull request #1593 from ishaan-arora-1/fix/typos-in-error-messages
Fix typos in user-facing error and warning messages
2 parents 0121e19 + 443f3a1 commit d111d2a

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/frontend/Semantic_error.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ module ExpressionError = struct
479479
| TupleIndexInvalidIndex (ix_max, ix) ->
480480
Fmt.pf ppf
481481
"Tried to access index %d for a tuple of length %d.@ Only indices \
482-
indices between 1 and %d are valid."
482+
between 1 and %d are valid."
483483
ix ix_max ix_max
484484
| TupleIndexNotTuple ut ->
485485
Fmt.pf ppf "Tried to index a non-tuple type. Expression has type %a."

src/frontend/Typechecker.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ and check_expression cf tenv ({emeta; expr} : Ast.untyped_expression) :
10171017
(Fmt.str
10181018
"@[<v>Found chained comparison%aThis is interpreted \
10191019
as%tConsider if the intended meaning was%tinstead. You \
1020-
can silence this warning by adding explicit parenthesis. \
1020+
can silence this warning by adding explicit parentheses. \
10211021
This can be automatically changed using the canonicalize \
10221022
flag for stanc@]"
10231023
(pp_indented_box Pretty_printing.pp_expression)

test/integration/bad/tuples/stanc.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Semantic error in 'bad-index2.stan', line 3, column 11 to column 17:
4545
-------------------------------------------------
4646

4747
Tried to access index 3 for a tuple of length 2.
48-
Only indices indices between 1 and 2 are valid.
48+
Only indices between 1 and 2 are valid.
4949
[exit 1]
5050
$ ../../../../../install/default/bin/stanc bad-index3.stan
5151
Semantic error in 'bad-index3.stan', line 3, column 3 to column 6:
@@ -70,7 +70,7 @@ Semantic error in 'bad-index4.stan', line 3, column 2 to column 8:
7070
-------------------------------------------------
7171

7272
Tried to access index 3 for a tuple of length 2.
73-
Only indices indices between 1 and 2 are valid.
73+
Only indices between 1 and 2 are valid.
7474
[exit 1]
7575
$ ../../../../../install/default/bin/stanc bad-index5.stan
7676
Semantic error in 'bad-index5.stan', line 3, column 11 to column 18:

test/integration/cli-args/canonicalize/canonical.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 22:
247247
(1 < 2) > 3
248248
Consider if the intended meaning was
249249
1 < 2 && 2 > 3
250-
instead. You can silence this warning by adding explicit parenthesis.
250+
instead. You can silence this warning by adding explicit parentheses.
251251
This can be automatically changed using the canonicalize flag for stanc
252252
Warning in 'parenthesize.stan', line 27, column 13 to column 26:
253253
Found chained comparison
@@ -256,7 +256,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 26:
256256
(1 < 2 > 3) < 4
257257
Consider if the intended meaning was
258258
1 < 2 > 3 && 3 < 4
259-
instead. You can silence this warning by adding explicit parenthesis.
259+
instead. You can silence this warning by adding explicit parentheses.
260260
This can be automatically changed using the canonicalize flag for stanc
261261
[exit 0]
262262
$ ../../../../../install/default/bin/stanc --print-canonical squaremc.stan

test/integration/cli-args/canonicalize/deprecations-only.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 22:
226226
(1 < 2) > 3
227227
Consider if the intended meaning was
228228
1 < 2 && 2 > 3
229-
instead. You can silence this warning by adding explicit parenthesis.
229+
instead. You can silence this warning by adding explicit parentheses.
230230
This can be automatically changed using the canonicalize flag for stanc
231231
Warning in 'parenthesize.stan', line 27, column 13 to column 26:
232232
Found chained comparison
@@ -235,7 +235,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 26:
235235
(1 < 2 > 3) < 4
236236
Consider if the intended meaning was
237237
1 < 2 > 3 && 3 < 4
238-
instead. You can silence this warning by adding explicit parenthesis.
238+
instead. You can silence this warning by adding explicit parentheses.
239239
This can be automatically changed using the canonicalize flag for stanc
240240
[exit 0]
241241
$ ../../../../../install/default/bin/stanc --auto-format --canonicalize deprecations squaremc.stan

test/integration/cli-args/canonicalize/everything-but.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 22:
268268
(1 < 2) > 3
269269
Consider if the intended meaning was
270270
1 < 2 && 2 > 3
271-
instead. You can silence this warning by adding explicit parenthesis.
271+
instead. You can silence this warning by adding explicit parentheses.
272272
This can be automatically changed using the canonicalize flag for stanc
273273
Warning in 'parenthesize.stan', line 27, column 13 to column 26:
274274
Found chained comparison
@@ -277,7 +277,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 26:
277277
(1 < 2 > 3) < 4
278278
Consider if the intended meaning was
279279
1 < 2 > 3 && 3 < 4
280-
instead. You can silence this warning by adding explicit parenthesis.
280+
instead. You can silence this warning by adding explicit parentheses.
281281
This can be automatically changed using the canonicalize flag for stanc
282282
[exit 0]
283283
$ ../../../../../install/default/bin/stanc --auto-format --canonicalize braces,parentheses squaremc.stan

test/integration/cli-args/canonicalize/strip-comments.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 22:
235235
(1 < 2) > 3
236236
Consider if the intended meaning was
237237
1 < 2 && 2 > 3
238-
instead. You can silence this warning by adding explicit parenthesis.
238+
instead. You can silence this warning by adding explicit parentheses.
239239
This can be automatically changed using the canonicalize flag for stanc
240240
Warning in 'parenthesize.stan', line 27, column 13 to column 26:
241241
Found chained comparison
@@ -244,7 +244,7 @@ Warning in 'parenthesize.stan', line 27, column 13 to column 26:
244244
(1 < 2 > 3) < 4
245245
Consider if the intended meaning was
246246
1 < 2 > 3 && 3 < 4
247-
instead. You can silence this warning by adding explicit parenthesis.
247+
instead. You can silence this warning by adding explicit parentheses.
248248
This can be automatically changed using the canonicalize flag for stanc
249249
[exit 0]
250250
$ ../../../../../install/default/bin/stanc --auto-format --canonicalize strip-comments,braces,parentheses,deprecations squaremc.stan

test/integration/good/warning/pretty.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Warning in 'deprecated_syntax.stan', line 2, column 6 to column 15:
3636
(1 < 2) < 3
3737
Consider if the intended meaning was
3838
1 < 2 && 2 < 3
39-
instead. You can silence this warning by adding explicit parenthesis.
39+
instead. You can silence this warning by adding explicit parentheses.
4040
This can be automatically changed using the canonicalize flag for stanc
4141
Warning in 'deprecated_syntax.stan', line 2, column 6 to column 19:
4242
Found chained comparison
@@ -45,7 +45,7 @@ Warning in 'deprecated_syntax.stan', line 2, column 6 to column 19:
4545
(1 < 2 < 3) < 4
4646
Consider if the intended meaning was
4747
1 < 2 < 3 && 3 < 4
48-
instead. You can silence this warning by adding explicit parenthesis.
48+
instead. You can silence this warning by adding explicit parentheses.
4949
This can be automatically changed using the canonicalize flag for stanc
5050
[exit 0]
5151
$ ../../../../../install/default/bin/stanc --auto-format empty.stan

0 commit comments

Comments
 (0)