Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
DePasqualeOrg committed Oct 1, 2024
1 parent 0a4d414 commit 6a9ba03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/Ast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ struct KeywordArgumentExpression: Expression {
}

struct NullLiteral: Literal {
var value: Any? = nil
var value: Any? = nil
}
6 changes: 3 additions & 3 deletions Sources/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ class Environment {
return ObjectValue(value: object)
case is NullValue:
return NullValue()
case Optional<Any>.none:
return NullValue()
// case Optional<Any>.none:
// return NullValue()
default:
throw JinjaError.runtime("Cannot convert to runtime value: \(input) type:\(type(of: input))")
}
}

@discardableResult
func set(name: String, value: Any?) throws -> any RuntimeValue {
func set(name: String, value: Any) throws -> any RuntimeValue {
try self.declareVariable(name: name, value: self.convertToRuntimeValues(input: value))
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Runtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct BooleanValue: RuntimeValue {
}

struct NullValue: RuntimeValue {
var value: Any? = nil
var value: (any RuntimeValue)?
var builtins: [String: any RuntimeValue] = [:]

func bool() -> Bool {
Expand Down

0 comments on commit 6a9ba03

Please sign in to comment.