Calamity210 / BirbLang

Minimal Bird programming language curated to help new contributers delve into OSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Can't chain operations

Calamity210 opened this issue · comments

commented

Describe the bug
Chaining operations results in an error. As an example, for "foo".length.isEven. The attribute access is handled as "foo.(length.isEven)" rather than (foo.length).isEven

To Reproduce
Steps to reproduce the behavior:

  1. Launch birb shell with the birb command
  2. Type
String str = "Foo";
bool isEven = str.length.isEven;
  1. See error

Expected behavior
Expect bool isEven to be false

Logs
Unhandled exception:
UndefinedVariableException: Error: [Line 2] Undefined variable `length`.
#0      visitVariable (package:Birb/runtime/runtime.dart:407:3)
<asynchronous suspension>
#1      visit (package:Birb/runtime/runtime.dart:211:20)
#2      visitAttAccess (package:Birb/runtime/runtime.dart:900:22)
#3      visit (package:Birb/runtime/runtime.dart:267:20)
#4      visitAttAccess (package:Birb/runtime/runtime.dart:1011:24)
<asynchronous suspension>
#5      visit (package:Birb/runtime/runtime.dart:267:20)
#6      visitVarDef (package:Birb/runtime/runtime.dart:438:34)
#7      visit (package:Birb/runtime/runtime.dart:213:20)
#8      visitCompound (package:Birb/runtime/runtime.dart:866:25)
<asynchronous suspension>
#9      visit (package:Birb/runtime/runtime.dart:241:20)
#10     main (package:Birb/birb.dart:93:9)
#11     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Process finished with exit code 255
commented

Corrected in bd1cc24