View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000528 | mercury | Bug | public | 2021-01-29 21:40 | 2021-01-30 01:46 | ||||
Reporter | dirkz | ||||||||
Assigned To | zs | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | Mercury 20.06 / rotd-2021-01-27 | OS | MacOS Catalina, Intel | OS Version | 10.15.7 | ||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000528: Compiler aborts when constructing invalid inst | ||||||||
Description | I want Mercury's mode checker to enforce following HTML validation rules via insts: - An ul tag (unordered list) allows only li tags (list item) as direct children - An li tag must have an ol tag as immediate parent Expected result: Compiler should report an error when creating an invalid inst. Actual result: Compiler aborts. The error occurs with Mercury 20.06 as well as with rotd-2021-01-27. | ||||||||
Steps To Reproduce | mmc --make html | ||||||||
Additional Information | $ mmc --make html Making Mercury/int3s/html.int3 Making Mercury/ints/html.int Making Mercury/cs/html.c Uncaught Mercury exception: Software Error: map.det_insert: key already present Key Type: parse_tree.prog_data.inst_name Key Value: user_inst(qualified(unqualified("html"), "non_empty_list"), [defined_inst(user_inst(qualified(unqualified("html"), "top_body_elem"), []))]) Value Type: list.list(parse_tree.error_util.format_component) ** Error making `Mercury/cs/html.c'. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
zs (developer) 2021-01-30 01:34 |
I am testing a fix now. However, if I were you, I would choose a HTML representation that encoded HTML's invariants in the type, not in the mode. It would not have any representation for symbol for lists would look like this: :- type html_elem ---> list(html_elem, list(html_elem)) ... The (Not having an explicit representation for that this representation cannot be put anywhere it shouldn't :-) And storing the first element of the list separately guarantees that the empty list is not representable. |
zs (developer) 2021-01-30 01:36 |
Sorry about the formatting of the above note. I didn't realize that Mantis does not quote html in notes :-( Those bullets were originally a sequence of <, l, i, and >. |
zs (developer) 2021-01-30 01:46 |
Fix committed 2021 Jan 30. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-29 21:40 | dirkz | New Issue | |
2021-01-29 21:40 | dirkz | File Added: html.m | |
2021-01-30 01:25 | zs | Assigned To | => zs |
2021-01-30 01:25 | zs | Status | new => assigned |
2021-01-30 01:34 | zs | Note Added: 0001129 | |
2021-01-30 01:36 | zs | Note Added: 0001130 | |
2021-01-30 01:46 | zs | Status | assigned => resolved |
2021-01-30 01:46 | zs | Resolution | open => fixed |
2021-01-30 01:46 | zs | Note Added: 0001131 |