Skip to content

Commit

Permalink
Fix Void callability
Browse files Browse the repository at this point in the history
  • Loading branch information
phorward committed Jun 2, 2024
1 parent e5ff017 commit 00baed1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/compiler/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ fn traverse_node(scope: &Scope, node: &Dict) -> ImlOp {
scope.error(
traverse_node_offset(node),
format!(
"Cannot assign constant '{}' as consumable. Use an identifier starting in upper-case, e.g. '{}{}'",
"Cannot assign to constant '{}' as consumable. Use an identifier starting in upper-case, e.g. '{}{}'",
ident, &ident[0..1].to_uppercase(), &ident[1..]
)
);
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/iml/imlvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl ImlValue {
pub fn is_callable(&self, without_arguments: bool) -> bool {
match self {
Self::Shared(value) => value.borrow().is_callable(without_arguments),
Self::SelfValue | Self::SelfToken => true, // fixme?
Self::SelfValue | Self::SelfToken | Self::VoidToken => true,
Self::Value(value) => value.is_callable(without_arguments),
Self::Parselet(parselet) => {
let parselet = parselet.borrow();
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler_identifiers.tok
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ _ : "abc"

#---
#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'
#ERR:Line 5, column 1: Cannot assign constant 'cident' as consumable. Use an identifier starting in upper-case, e.g. 'Cident'
#ERR:Line 5, column 1: Cannot assign to constant 'cident' as consumable. Use an identifier starting in upper-case, e.g. 'Cident'
#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'
#ERR:Line 18, column 1: Cannot assign to constant '_', because it must be consumable. Use an identifier not starting with '_'.

0 comments on commit 00baed1

Please sign in to comment.