kosen13s / tiny

A tiny programming language to improve kosen13s' skills
MIT License
4 stars 0 forks source link

adapt parenthesized expressions #13

Closed Roadagain closed 7 years ago

Roadagain commented 7 years ago

next, adapt tiny to bracketed expressions!

Iruyan-Zak commented 7 years ago

Why not adding Parenthesized [Token] constructor to Token ? I think to specialize parenthesized tokens makes the implements simple.

Does anyone have (tiny|concrete) idea?

Roadagain commented 7 years ago

great, i'm gonna do it.

Roadagain commented 7 years ago

i guessed Parenthesized node will have only one Tree, so it seems like an edge. is it really needed?

if construct from "(1+2)*3", the tree should be like this:

    *
   / \
  +   3
 / \
1   2

if it is not, i need some reasons to understand.

Iruyan-Zak commented 7 years ago

All right. You can leave parenthesized operator, but it is not important.

In lexical parser layer, I send you Parenthesized token, so I leave how treat it to you .

Iruyan-Zak commented 7 years ago

I implemented parenthesized parser. If it has no problem, please merge and engage in syntactic approach.

Roadagain commented 7 years ago

i have merged it. great job :+1:

Iruyan-Zak commented 7 years ago

Looks good! Can I merge this commit?

Roadagain commented 7 years ago

sorry to be late, PR was created. please merge it!

Roadagain commented 7 years ago

close via #14 and #17.