|
238 | 238 | | [] -> |
239 | 239 | let post = rhs_post_text endpos in |
240 | 240 | @@@@ |
241 | | - let docs = symbol_docs loc in |
242 | | - { |
243 | | - lb_pattern = p; |
244 | | - lb_expression = e; |
245 | | - lb_is_pun = is_pun; |
246 | | -- lb_attributes = (add_docs_attrs docs attrs); |
247 | | -+ lb_attributes = add_docs_attrs docs attrs; |
| 241 | + lb_attributes = add_text_attrs text (add_docs_attrs docs attrs); |
248 | 242 | lb_loc = make_loc loc; |
249 | 243 | } |
250 | 244 |
|
|
403 | 397 | produces a first-class module that we wish to unpack. *) |
404 | 398 | %inline expr_colon_package_type: |
405 | 399 | @@@@ |
406 | | - ext = ext |
407 | | - before = attributes |
408 | 400 | body = body |
409 | 401 | after = post_item_attributes |
410 | 402 | { let loc = make_loc $sloc in |
411 | | -- let docs = symbol_docs $sloc in |
412 | | - let text = symbol_text $symbolstartpos in |
413 | | -+ let docs = symbol_docs $sloc in |
| 403 | + let docs = symbol_docs $sloc in |
414 | 404 | let attrs = Attr.ext_attrs ?ext ~before ~after () in |
415 | | - body ~loc ~attrs ~docs ~text } |
| 405 | +- body ~loc ~attrs ~docs ~text:None } |
| 406 | ++ body ~text:None ~loc ~attrs ~docs } |
416 | 407 |
|
417 | 408 |
|
418 | 409 | %inline ext_attrs_no_ext(kw, body): |
|
421 | 412 | body = body |
422 | 413 | after = post_item_attributes |
423 | 414 | { let loc = make_loc $sloc in |
424 | | -+ let text = symbol_text $symbolstartpos in |
| 415 | ++ let text = Some (symbol_text $symbolstartpos) in |
425 | 416 | let docs = symbol_docs $sloc in |
426 | | -- let text = symbol_text $symbolstartpos in |
| 417 | +- let text = Some (symbol_text $symbolstartpos) in |
427 | 418 | let attrs = Attr.ext_attrs ~before ~after () in |
428 | | - body ~loc ~attrs ~docs ~text } |
| 419 | +- body ~loc ~attrs ~docs ~text } |
| 420 | ++ body ~text ~loc ~attrs ~docs } |
429 | 421 |
|
430 | 422 | (* A single module binding. *) |
431 | 423 | %inline module_binding: |
|
474 | 466 |
|
475 | 467 | (* The following bindings in a group of recursive module bindings. *) |
476 | 468 | %inline and_module_binding: |
| 469 | + ext_attrs_no_ext ( |
| 470 | + AND, |
| 471 | + name = mkrhs(module_name) |
| 472 | + body = module_binding_body |
| 473 | +- { fun ~text -> Mb.mk_exh ~text name body } |
| 474 | ++ { Mb.mk_exh name body } |
| 475 | + ) |
| 476 | + { $1 } |
| 477 | + ; |
| 478 | + |
| 479 | + (* -------------------------------------------------------------------------- *) |
477 | 480 | @@@@ |
478 | 481 | Incl.mk thing ~attrs ~loc ~docs, ext |
479 | 482 | } |
|
613 | 616 | ext_attrs_no_ext ( |
614 | 617 | AND, |
615 | 618 | @@@@ |
| 619 | + { |
| 620 | + let attrs = attrs1 @ attrs2 in |
| 621 | + let loc = make_loc $sloc in |
| 622 | + let docs = symbol_docs $sloc in |
| 623 | + let text = symbol_text $symbolstartpos in |
| 624 | +- Ci.mk id body ~virt ~params ~attrs ~loc ~text ~docs |
| 625 | ++ Ci.mk id body ~virt ~params ~attrs ~loc ~docs ~text |
| 626 | + } |
| 627 | + ; |
| 628 | + |
| 629 | + class_fun_binding: |
| 630 | + EQUAL class_expr |
| 631 | +@@@@ |
616 | 632 |
|
617 | 633 | (* -------------------------------------------------------------------------- *) |
618 | 634 |
|
|
673 | 689 | | LET OPEN override_flag attributes mkrhs(mod_longident) IN class_signature |
674 | 690 | { let loc = ($startpos($2), $endpos($5)) in |
675 | 691 | let od = Opn.mk ~override:$3 ~loc:(make_loc loc) $5 in |
| 692 | +@@@@ |
| 693 | + { |
| 694 | + let attrs = attrs1 @ attrs2 in |
| 695 | + let loc = make_loc $sloc in |
| 696 | + let docs = symbol_docs $sloc in |
| 697 | + let text = symbol_text $symbolstartpos in |
| 698 | +- Ci.mk id cty ~virt ~params ~attrs ~loc ~text ~docs |
| 699 | ++ Ci.mk id cty ~virt ~params ~attrs ~loc ~docs ~text |
| 700 | + } |
| 701 | + ; |
| 702 | + class_type_declarations: |
| 703 | + xlist(class_type_declaration, and_class_type_declaration) |
| 704 | + { $1 } |
| 705 | +@@@@ |
| 706 | + { |
| 707 | + let attrs = attrs1 @ attrs2 in |
| 708 | + let loc = make_loc $sloc in |
| 709 | + let docs = symbol_docs $sloc in |
| 710 | + let text = symbol_text $symbolstartpos in |
| 711 | +- Ci.mk id csig ~virt ~params ~attrs ~loc ~text ~docs |
| 712 | ++ Ci.mk id csig ~virt ~params ~attrs ~loc ~docs ~text |
| 713 | + } |
| 714 | + ; |
| 715 | + |
| 716 | + /* Core expressions */ |
| 717 | + |
676 | 718 | @@@@ |
677 | 719 | { array, d, Brace, i, r } |
678 | 720 | | array=simple_expr d=dot LBRACKET i=index RBRACKET r=right |
|
969 | 1011 | ps = separated_or_terminated_nonempty_list(SEMI, pattern) |
970 | 1012 | { ps } |
971 | 1013 | ; |
| 1014 | +@@@@ |
| 1015 | + cstrs = constraints |
| 1016 | + attrs2 = post_item_attributes |
| 1017 | + { |
| 1018 | + let (kind, priv, manifest) = kind_priv_manifest in |
| 1019 | + let docs = symbol_docs $sloc in |
| 1020 | +- let text = symbol_text $symbolstartpos in |
| 1021 | + let attrs = attrs1 @ attrs2 in |
| 1022 | + let loc = make_loc $sloc in |
| 1023 | ++ let text = symbol_text $symbolstartpos in |
| 1024 | + Type.mk id ~params ~cstrs ~kind ~priv ?manifest ~attrs ~loc ~docs ~text |
| 1025 | + } |
| 1026 | + ; |
| 1027 | + %inline constraints: |
| 1028 | + llist(preceded(CONSTRAINT, constrain)) |
972 | 1029 | @@@@ |
973 | 1030 | | BANG { [ mkvarinj "!" $sloc ] } |
974 | 1031 | | PLUS BANG { [ mkvarinj "+" $loc($1); mkvarinj "!" $loc($2) ] } |
|
0 commit comments