jmeaster30 / ocean

A C-like programming language (get it like sea-like like an ocean lol)
GNU General Public License v3.0
0 stars 0 forks source link

Add comments and whitespace as trivia to the token #105

Closed jmeaster30 closed 4 months ago

jmeaster30 commented 4 months ago

Currently, we drop all whitespace and comments are parsed into a statement level "trivia" type thing.

However, most places where we see a comment in the parser we just drop it. This would be bad for formatters since it would essentially dropped all comments.

If we add whitespace and comments as trivia in the lexing step then we don't need to worry about parsing it properly everywhere.

jmeaster30 commented 4 months ago

Done