Skip to content

Commit

Permalink
Fix error message in loop syntax (#120)
Browse files Browse the repository at this point in the history
* Fix error message in loop syntax

* Fix error message thrown in loops

---------

Co-authored-by: Zsolt Váradi <1783465+vzsg@users.noreply.github.com>
  • Loading branch information
0xTim and vzsg authored Mar 7, 2023
1 parent 1eddd30 commit 62169b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/LeafKit/LeafSyntax/LeafSyntax.swift
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ extension Syntax {
k == .in,
case .parameter(let right) = list[2],
case .variable(let array) = right
else { throw "for loops expect one of the following expressions: 'name in names' or 'name, nameIndex in names'" }
else { throw "for loops expect one of the following expressions: 'name in names' or 'nameIndex, name in names'" }
self.item = item
self.array = array
self.index = "index"
Expand All @@ -572,7 +572,7 @@ extension Syntax {
k == .in,
case .parameter(let right) = list[2],
case .variable(let array) = right
else { throw "for loops expect one of the following expressions: 'name in names' or 'name, nameIndex in names'" }
else { throw "for loops expect one of the following expressions: 'name in names' or 'nameIndex, name in names'" }
self.item = item
self.array = array
self.index = index
Expand Down

0 comments on commit 62169b4

Please # to comment.