minor fixes

This commit is contained in:
Louis Heredero 2024-06-20 18:02:13 +02:00
parent 3610c86884
commit ef73f98dd0
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7

View File

@ -22,9 +22,21 @@
while i < elmts.len() { while i < elmts.len() {
let elmt = elmts.at(i) let elmt = elmts.at(i)
if elmt.type == "grp" { if elmt.type == "grp" {
let grp-elmts = elmt.elmts
elmt.elmts = elmt.elmts.map(e => {
if e.type == "seq" {
if e.p1 == "?" {
e.p1 = "?" + e.p2
} else if e.p2 == "?" {
e.p2 = e.p1 + "?"
}
}
e
})
elmts.at(i) = elmt
elmts = ( elmts = (
elmts.slice(0, i + 1) + elmts.slice(0, i + 1) +
elmt.elmts + grp-elmts +
(( ((
type: "grp-end" type: "grp-end"
),) + ),) +
@ -46,6 +58,10 @@
if not participant._exists(participants, elmt.p2) { if not participant._exists(participants, elmt.p2) {
let par = _par(elmt.p2, from-start: not elmt.create-dst).first() let par = _par(elmt.p2, from-start: not elmt.create-dst).first()
participants.push(par) participants.push(par)
} else if elmt.create-dst {
let i = participants.position(p => p.name == elmt.p2)
participants.at(i).from-start = false
} }
if elmt.p1 == "?" { if elmt.p1 == "?" {