presidentbeef / brat

Brat is a little language for people who don't like to be told what to do.
https://www.brat-lang.info/
93 stars 6 forks source link

Confusing error from parentheses / comma in the wrong place #23

Closed catb0t closed 5 years ago

catb0t commented 5 years ago

These work:

p p(1)
p (p 1) 
p p 1
p p, 1
p 9 8 
p 9, 8

These don't

p (p, 1) 
(9, 8)
(9 8) 
9 8
p (9 8)
p (9, 8) 

I think some of these are valid syntax. They all fail with the same inexplicable error:

lua: Method error: false has no method called 'ast'.
stack traceback:
    [C]: in function '_error'
    stdlib/parser/brat2lua.lua:547: in function 'run'
    bin/brat:108: in function 'interactive'
    bin/brat:142: in main chunk
    [C]: at 0x5606b9b5d150
catb0t commented 5 years ago

This also happens when mistyping x.method as .method

catb0t commented 5 years ago

Ah, this is just how Brat responds to almost all wrong syntax. I see!