syntax icon indicating copy to clipboard operation
syntax copied to clipboard

`assert` priority

Open bloodyowl opened this issue 5 years ago • 3 comments

assert 1 == 2

is parsed as

(assert 1) == 2

Wouldn't it have a better UX if we had one of the following?

  • we considered assert like a regular function call (assert(1 == 2))
  • we change the priority to parse as assert (1 == 2)

bloodyowl avatar Nov 08 '20 18:11 bloodyowl

This is a very good idea. I'll look into this. Are you suggesting printing parens as in assert(1 == 2)?

IwanKaramazow avatar Nov 08 '20 19:11 IwanKaramazow

Yeah, I think that'd look more familiar if it looked like a regular function call 🙂

bloodyowl avatar Nov 09 '20 13:11 bloodyowl

consider assert as a regular function makes more sense to me assert (1==2)

bobzhang avatar Jan 04 '21 09:01 bobzhang

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

stale[bot] avatar May 29 '23 03:05 stale[bot]