Skip to content

Commit 87829a7

Browse files
committed
Fix return type for is_empty to be Bool, not String
1 parent 95c0086 commit 87829a7

5 files changed

Lines changed: 9 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ See [/spec](./spec/) for more syntax examples.
6767
| --------------------------------------------------------- | ----------------------------------------------- |
6868
| `id(value: Value) -> Value` | Returns the string arugment passed to it |
6969
| `noop() -> String` | Returns the string "noop" |
70-
| `is_empty(value: String) -> String` | Checks if the given string is empty |
70+
| `is_empty(value: String) -> Bool` | Checks if the given string is empty |
7171
| `and(a: Bool, b: Bool) -> Bool` | Logical AND operation between two booleans |
7272
| `or(a: Bool, b: Bool) -> Bool` | Logical OR operation between two booleans |
7373
| `cond(cond: Bool, then: Value, else: Value) -> Bool` | Conditional expression |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(type is_empty)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
VERSION 0800
2+
----
3+
0000 GET BUILTIN 14 == 'type'
4+
0003 GET BUILTIN 2 == 'is_empty'
5+
0006 CALL (1 args)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Type<Fn(String) -> Bool>

src/builtins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl<'a> BuiltinFn<'a> {
129129
ty: Type::String,
130130
variadic: false,
131131
}],
132-
return_type: Type::String,
132+
return_type: Type::Bool,
133133
func: Self::is_empty,
134134
};
135135

0 commit comments

Comments
 (0)