mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
For loop in tags rendering
This commit is contained in:
parent
1691b96197
commit
d5c729b817
1 changed files with 3 additions and 13 deletions
|
@ -301,32 +301,22 @@ fn type_annotation_to_html(indent_level: usize, buf: &mut String, type_ann: &Typ
|
|||
buf.push('[');
|
||||
buf.push_str("<br>");
|
||||
|
||||
let mut index = 0;
|
||||
let next_indent_level = tag_union_indent + 1;
|
||||
let tags_len = tags.len();
|
||||
while index < tags_len {
|
||||
let tag = &tags[index];
|
||||
|
||||
for (index, tag) in tags.iter().enumerate() {
|
||||
indent(buf, next_indent_level);
|
||||
buf.push_str(tag.name.as_str());
|
||||
|
||||
let mut tag_value_index = 0;
|
||||
while tag_value_index < tag.values.len() {
|
||||
let type_value = &tag.values[tag_value_index];
|
||||
|
||||
for type_value in &tag.values {
|
||||
buf.push(' ');
|
||||
type_annotation_to_html(next_indent_level, buf, type_value);
|
||||
|
||||
tag_value_index += 1;
|
||||
}
|
||||
|
||||
if index < (tags_len - 1) {
|
||||
if index < (tags.len() - 1) {
|
||||
buf.push(',');
|
||||
}
|
||||
|
||||
buf.push_str("<br>");
|
||||
|
||||
index += 1;
|
||||
}
|
||||
|
||||
indent(buf, tag_union_indent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue