Repository navigation
Commit 72dc59f
committed
fix(haskell): name infix-form definitions after the operator (DeusData#2440)
A Haskell definition written in infix form (`a <+> b = ...`,
``x `plus` y = ...``) has no `name` field. resolve_haskell_func_name
took the first child of its `infix` head, which is the left operand, so
the def was indexed as `a` / `x` and the operator itself got no node.
Resolve the head's `operator` field instead: a backticked `infix_id`
yields its inner variable (`plus`), and a symbolic `operator` is
parenthesised in cbm_func_name_node_text (`(<+>)`), matching the name
the prefix form `(<+>) a b = ...` already gets. The def extractor and
the call-scope QN both go through these two functions, so they stay in
agreement.
Fixes DeusData#2440
Signed-off-by: Edson <zhuoxi2000@gmail.com>1 parent 0f52d30 commit 72dc59f
3 files changed
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
408 | 435 | | |
409 | 436 | | |
410 | 437 | | |
| |||
413 | 440 | | |
414 | 441 | | |
415 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
416 | 446 | | |
417 | 447 | | |
418 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1045 | 1053 | | |
1046 | 1054 | | |
1047 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1377 | 1377 | | |
1378 | 1378 | | |
1379 | 1379 | | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1380 | 1407 | | |
1381 | 1408 | | |
1382 | 1409 | | |
| |||
8954 | 8981 | | |
8955 | 8982 | | |
8956 | 8983 | | |
| 8984 | + | |
8957 | 8985 | | |
8958 | 8986 | | |
8959 | 8987 | | |
| |||
0 commit comments