shiika icon indicating copy to clipboard operation
shiika copied to clipboard

Allow a line starts with `.`

Open yhara opened this issue 2 years ago • 4 comments

GIven

123
  .to_s

Expected

no error

Actual

Error: Error: unexpected token: Dot
   ╭─[a.sk:8:3]
   │
 8 │   .to_s
   ·   ─  
   ·       
───╯
)

yhara avatar Aug 27 '22 11:08 yhara

Test case 2:

p 123
    + 345

Test case 3 (from #385):

p 123  # comment
    + 345

yhara avatar Dec 15 '22 10:12 yhara

Test case 4 (same as test case 1) but from #241 (we can close that issue I guess)

p [1,2,3]
  .select{|i: Int| i % 2 == 0}
  .map<Int>{|i: Int| i * 2}

AI-Mozi avatar Dec 15 '22 11:12 AI-Mozi

It's good to start after #534 was merged. Because #534 introduce Token::Semicolon and Token::Newline.

By using those tokens, we could easily implement this feature allowing a line starts with dot.

I have willingness to implement this later.

yamakoud avatar Jan 04 '24 06:01 yamakoud

#534 was merged. So I'm going to work on this issue.

yamakoud avatar Jan 05 '24 14:01 yamakoud