Modify

Ticket #37 (closed defect: invalid)

Opened 7 years ago

Last modified 7 years ago

Cross referenced aliases unsupported ?

Reported by: Pwipwi Owned by: xi
Priority: normal Component: pyyaml
Severity: normal Keywords:
Cc:

Description

Hi, the following doesn't work :

- &element1
  stuff: "Hey !"
  link: *element2 # this causes trouble

- &element2
  stuff: "Ho !"
  link: *element1

Is it normal, or is it just unsupported for now ? It would be nice to have it :)

Attachments

Change History

comment:1 Changed 7 years ago by xi

  • Status changed from new to closed
  • Resolution set to invalid

In YAML, anchors (like &element2) should be defined before the corresponding aliases (like *element2) can be used.

To fix your example, you need to rewrite it in the form:

- &element1
  stuff: "Hey !"
  link:
    - &element2
      stuff: "Ho !"
      link: *element1
- *element2

Alternatively, you may consider changing the schema to something like:

elements:
- &element1
  stuff: "Hey !"
- &element2
  stuff: "Ho !"
links:
- from: *element1
  to: *element2
- from: *element2
  to: *element1
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.