Make Formatter Happy

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-02 08:26:37 -05:00
parent 6dba17c97a
commit 59d56e7b73
6 changed files with 21 additions and 11 deletions
+5 -2
View File
@@ -52,7 +52,8 @@ extension ParserAssignmentStatement: CompilableStatement {
ErrorOnNode(node: node, withError: "Missing rvalue in assignment statement"))
}
let maybe_parsed_rvalue = Expression.Compile(node: rvalue_node, inTree: tree, withScopes: scopes)
let maybe_parsed_rvalue = Expression.Compile(
node: rvalue_node, inTree: tree, withScopes: scopes)
guard case Result.Ok(let rvalue) = maybe_parsed_rvalue else {
return Result.Error(maybe_parsed_rvalue.error()!)
}
@@ -289,7 +290,9 @@ public struct Parser {
}
}
return switch TransitionSelectExpression.Compile(node: node, inTree: tree, withScope: scopes) {
return
switch TransitionSelectExpression.Compile(node: node, inTree: tree, withScope: scopes)
{
case .Ok((let tse, _)):
.Ok((ParserTransitionStatement(withTransitionExpression: tse), scopes))
case .Error(let e): .Error(e)
+12 -5
View File
@@ -57,7 +57,9 @@ extension BlockStatement: CompilableStatement {
}
currentChild = node.child(at: currentChildIdx)
if currentChild!.nodeType == "statements" {
switch Parser.Statements.Compile(node: currentChild!, inTree: tree, withLexicalScopes: scopes.enter()) {
switch Parser.Statements.Compile(
node: currentChild!, inTree: tree, withLexicalScopes: scopes.enter())
{
case .Ok(let (parsed_statements, parsed_scopes)):
new_scopes = parsed_scopes
statements = parsed_statements
@@ -112,7 +114,8 @@ extension ConditionalStatement: CompilableStatement {
thens.nodeType == "statement"
else {
return Result.Error(
ErrorOnNode(node: node, withError: "Did not find then statement block for conditional statement"))
ErrorOnNode(
node: node, withError: "Did not find then statement block for conditional statement"))
}
guard
@@ -175,7 +178,8 @@ extension VariableDeclarationStatement: CompilableStatement {
typeref.nodeType == "typeRef"
else {
return Result.Error(
ErrorOnNode(node: node, withError: "Did not find type name for variable declaration statement"))
ErrorOnNode(
node: node, withError: "Did not find type name for variable declaration statement"))
}
let maybe_variablename = node.child(at: 1)
@@ -183,7 +187,8 @@ extension VariableDeclarationStatement: CompilableStatement {
variablename.nodeType == "identifier"
else {
return Result.Error(
ErrorOnNode(node: node, withError: "Did not find identifier name for variable declaration statement"))
ErrorOnNode(
node: node, withError: "Did not find identifier name for variable declaration statement"))
}
let maybe_rvalue = node.childCount > 3 ? node.child(at: 3) : .none
@@ -191,7 +196,9 @@ extension VariableDeclarationStatement: CompilableStatement {
rvalue.nodeType == "expression"
else {
return Result.Error(
ErrorOnNode(node: node, withError: "Did not find initial value expression for variable declaration statement"))
ErrorOnNode(
node: node,
withError: "Did not find initial value expression for variable declaration statement"))
}
guard