patbenatar / rbexy

A Ruby template language and component framework inspired by JSX and React
MIT License
34 stars 5 forks source link

Add OR operator to lexer #65

Closed nazamoresco closed 3 years ago

nazamoresco commented 3 years ago

I was using rbexy when I discovered something strange, all the OR operators that I added were failing, digging a little bit I discovered that rbexy does not support this operator which I was surprised since it does support the AND operator. I consider it a good idea since it improves consistency and if we take advantage of ruby's short circuit property we can do interesting things like: {false && <p>Is true</p> || <p>Is false</p>} This is my first pull request to an open-source project so any guidance is appreciated :)

patbenatar commented 3 years ago

@nazamoresco this is great, thank you! One request: would you mind adding a unit test for the lexer? e.g. https://github.com/patbenatar/rbexy/blob/ba11b96d73c148fb6deb7be5d9ddbedac557d0a5/spec/lib/rbexy/lexer_spec.rb#L407:L422