Skip to content

[bug] MScript overreaches while searching for callable expressions #204

@mrodz

Description

@mrodz

Documentation Status

Snippet Responsible

class Person { ... }
type NetID str

yale_database: map[NetID, Person] = map[NetID, Person] {
	"mtr39": Person("Mateo Rodriguez", 18)
}

mateo: NetID = "mtr39"

print yale_database

(yale_database[mateo]).grow_up()

print yale_database

Stack Trace of Error

Using build from 10-08-2025 13:53:33

[ Trace ] INIT Virtual Stack at MODULE
[00:00:00] Parsing (hello.ms):   !!! Error !!!                                                                                                                                        --> hello.ms:29:23
   |
29 | (yale_database[mateo]).grow_up()
   |                       ^---
   |
   = expected EOI, +, -, *, /, %, binary_xor, binary_and, binary_or, bitwise_ls, bitwise_rs, +=, -=, *=, /=, %=, <, >, <=, >=, ==, !=, &&, ||, ^, unwrap, is, or declaration
Error: Did not compile successfully (1 Error)

Expected Behavior

MScript is supposed to call grow_up on the value returned from the map.

Any ideas where MScript breaks?

  • Bytecode Interpreter
  • AST Parser
  • Compiler
  • Optimizer
  • Not Sure (It's okay!)
  • Other: please explain

Brain Dump (Optional)

The parenthesis trick the AST parser into thinking the previous expression (yale_database) is callable. Fix: ensure that LHS for callable expressions are on the same line.
That way,

some_function
(1)

Should eval to:

function ptr filename.mmm#__fn0()
1

Instead of some_function(1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions