===========================
Floating attributes
===========================

[@@@id]
[@@@I.D]
[@@@id let x = x]
[@@@id:]
[@@@id : t]
[@@@id : type t type t]
[@@@id ? A x]

---

(compilation_unit
  (floating_attribute
    (attribute_id))
  (floating_attribute
    (attribute_id))
  (floating_attribute
    (attribute_id)
    (attribute_payload
      (value_definition
        (let_binding
          pattern: (value_name)
          body: (value_path
            (value_name))))))
  (floating_attribute
    (attribute_id)
    (attribute_payload))
  (floating_attribute
    (attribute_id)
    (attribute_payload
      (type_constructor_path
        (type_constructor))))
  (floating_attribute
    (attribute_id)
    (attribute_payload
      (type_definition
        (type_binding
          name: (type_constructor)))
      (type_definition
        (type_binding
          name: (type_constructor)))))
  (floating_attribute
    (attribute_id)
    (attribute_payload
      (constructor_pattern
        (constructor_path
          (constructor_name))
        pattern: (value_pattern)))))

===========================
Item attributes
===========================

x [@@id] [@@id]
let x = x [@@id] and x = x [@@id]
module M = M [@@id]

---

(compilation_unit
  (expression_item
    (value_path
      (value_name))
    (item_attribute
      (attribute_id))
    (item_attribute
      (attribute_id)))
  (value_definition
    (let_binding
      pattern: (value_name)
      body: (value_path
        (value_name))
      (item_attribute
        (attribute_id)))
    (let_binding
      pattern: (value_name)
      body: (value_path
        (value_name))
      (item_attribute
        (attribute_id))))
  (module_definition
    (module_binding
      (module_name)
      body: (module_path
        (module_name))
      (item_attribute
        (attribute_id)))))

===========================
Attributes
===========================

let%id x = x and [@id] x = x [@id]
type t = A [@id] [@id]
type t = { x : t [@id]; [@id] }
module M = struct [@id] end [@id];;
x ;%id x

---

(compilation_unit
  (value_definition
    (attribute_id)
    (let_binding
      pattern: (value_name)
      body: (value_path
        (value_name)))
    (attribute
      (attribute_id))
    (let_binding
      pattern: (value_name)
      body: (value_path
        (value_name))))
  (attribute
    (attribute_id))
  (type_definition
    (type_binding
      name: (type_constructor)
      body: (variant_declaration
        (constructor_declaration
          (constructor_name)))))
  (attribute
    (attribute_id))
  (attribute
    (attribute_id))
  (type_definition
    (type_binding
      name: (type_constructor)
      body: (record_declaration
        (field_declaration
          (field_name)
          type: (type_constructor_path
            (type_constructor)))
        (attribute
          (attribute_id))
        (attribute
          (attribute_id)))))
  (module_definition
    (module_binding
      (module_name)
      body: (structure
        (attribute
          (attribute_id)))))
  (attribute
    (attribute_id))
  (expression_item
    (sequence_expression
      (value_path
        (value_name))
      (attribute_id)
      (value_path
        (value_name)))))

===========================
Item extension
===========================

[%%id];;
{%%M.id|payload|};;
{%%id ab|payload|ab};;

---

(compilation_unit
  (item_extension
    (attribute_id))
  (quoted_item_extension
    (attribute_id)
    (quoted_string_content))
  (quoted_item_extension
    (attribute_id)
    (quoted_string_content)))

===========================
Extension
===========================

module type T = [%id]
module M = [%id]
type t = [%id]
let x = [%id]
let x = {%id|payload|}
let x = {%id ab|payload|ab};;

---

(compilation_unit
  (module_type_definition
    (module_type_name)
    body: (extension
      (attribute_id)))
  (module_definition
    (module_binding
      (module_name)
      body: (extension
        (attribute_id))))
  (type_definition
    (type_binding
      name: (type_constructor)
      equation: (extension
        (attribute_id))))
  (value_definition
    (let_binding
      pattern: (value_name)
      body: (extension
        (attribute_id))))
  (value_definition
    (let_binding
      pattern: (value_name)
      body: (quoted_extension
        (attribute_id)
        (quoted_string_content))))
  (value_definition
    (let_binding
      pattern: (value_name)
      body: (quoted_extension
        (attribute_id)
        (quoted_string_content)))))
