@@ -70,7 +70,7 @@ public struct ErrorWithLocation: Errorable, Equatable, CustomStringConvertible {
|
|||||||
|
|
||||||
public struct Errors: Errorable, CustomStringConvertible {
|
public struct Errors: Errorable, CustomStringConvertible {
|
||||||
public func format(_ formatter: any Formattable) -> String {
|
public func format(_ formatter: any Formattable) -> String {
|
||||||
self.errors.map() { error in
|
self.errors.map { error in
|
||||||
error.format(formatter)
|
error.format(formatter)
|
||||||
}.joined(separator: "\n")
|
}.joined(separator: "\n")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,8 @@ public struct Parser {
|
|||||||
current_context = updated_context
|
current_context = updated_context
|
||||||
parsed_s.append(parsed_statement)
|
parsed_s.append(parsed_statement)
|
||||||
case .Error(let e):
|
case .Error(let e):
|
||||||
errors = if let errors = errors {
|
errors =
|
||||||
|
if let errors = errors {
|
||||||
errors.append(error: e)
|
errors.append(error: e)
|
||||||
} else {
|
} else {
|
||||||
e
|
e
|
||||||
@@ -255,7 +256,8 @@ public struct Parser {
|
|||||||
parsed_s = state_statements
|
parsed_s = state_statements
|
||||||
current_context = updated_context
|
current_context = updated_context
|
||||||
case .Error(let error):
|
case .Error(let error):
|
||||||
errors = if let errors = errors {
|
errors =
|
||||||
|
if let errors = errors {
|
||||||
errors.append(error: error)
|
errors.append(error: error)
|
||||||
} else {
|
} else {
|
||||||
error
|
error
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ public struct Program {
|
|||||||
break
|
break
|
||||||
case .Error(let e):
|
case .Error(let e):
|
||||||
found_parser = true
|
found_parser = true
|
||||||
errors = if let errors = errors {
|
errors =
|
||||||
|
if let errors = errors {
|
||||||
errors.append(error: e)
|
errors.append(error: e)
|
||||||
} else {
|
} else {
|
||||||
e
|
e
|
||||||
|
|||||||
Reference in New Issue
Block a user