Skip to content

Commit 00baed1

Browse files
committed
Fix Void callability
1 parent e5ff017 commit 00baed1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/compiler/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
11201120
scope.error(
11211121
traverse_node_offset(node),
11221122
format!(
1123-
"Cannot assign constant '{}' as consumable. Use an identifier starting in upper-case, e.g. '{}{}'",
1123+
"Cannot assign to constant '{}' as consumable. Use an identifier starting in upper-case, e.g. '{}{}'",
11241124
ident, &ident[0..1].to_uppercase(), &ident[1..]
11251125
)
11261126
);

src/compiler/iml/imlvalue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl ImlValue {
294294
pub fn is_callable(&self, without_arguments: bool) -> bool {
295295
match self {
296296
Self::Shared(value) => value.borrow().is_callable(without_arguments),
297-
Self::SelfValue | Self::SelfToken => true, // fixme?
297+
Self::SelfValue | Self::SelfToken | Self::VoidToken => true,
298298
Self::Value(value) => value.is_callable(without_arguments),
299299
Self::Parselet(parselet) => {
300300
let parselet = parselet.borrow();

tests/compiler_identifiers.tok

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ _ : "abc"
1919

2020
#---
2121
#ERR:Line 1, column 1: Cannot assign to constant 'Pi', because it must be consumable. Use an identifier starting in lower-case, e.g. 'pi'
22-
#ERR:Line 5, column 1: Cannot assign constant 'cident' as consumable. Use an identifier starting in upper-case, e.g. 'Cident'
22+
#ERR:Line 5, column 1: Cannot assign to constant 'cident' as consumable. Use an identifier starting in upper-case, e.g. 'Cident'
2323
#ERR:Line 12, column 1: Cannot assign to constant 'Factorial', because it must be consumable. Use an identifier starting in lower-case, e.g. 'factorial'
2424
#ERR:Line 18, column 1: Cannot assign to constant '_', because it must be consumable. Use an identifier not starting with '_'.

0 commit comments

Comments
 (0)