Replies: 4 comments 4 replies
-
What happens when you make your negative prefix operator have lower precedence than your infix minus operator? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Doesn't help. Here're my precedences:
```js
precedences: () => [
["apply", "mult", "add", "neg", "trailing_exp"],
],
```
It's still parsing `x - y - z` as `(apply
(name)
(neg
(apply
(name)
(neg
(name)))))))`
…On Wed, Dec 20, 2023 at 12:22 PM Andrew Helwer ***@***.***> wrote:
What happens when you make your negative prefix operator have lower
precedence than your infix minus operator?
—
Reply to this email directly, view it on GitHub
<#2818 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZTX2NK3IMYGXVB6GKB7U6LYKMNF3AVCNFSM6AAAAABAOV7X2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUHA2TONJSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
So your apply operator is higher precedence than infix op expression operator? What about playing around with those? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I can't figure out a way.
…On Wed, Dec 20, 2023 at 1:45 PM Andrew Helwer ***@***.***> wrote:
So your apply operator is higher precedence than infix op expression
operator? What about playing around with those?
—
Reply to this email directly, view it on GitHub
<#2818 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZTX2NPBH2L6DF2NOHLVQRTYKMW43AVCNFSM6AAAAABAOV7X2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUHE3TCNRRHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm writing a parser for a functional language, where function application is looks like
a b
, anda b c
is equivalent to(a b) c
. I'm having an issue wherea - b - c
is interpreted as callinga (-(b (-c)))
(i.e. callinga
with the negative result of callingb
with-c
). I'd like to solve this using the precedence operators, but haven't been able to find a way.Beta Was this translation helpful? Give feedback.
All reactions