Files
mercury/tests/valid_seq/xml_event_read_helper.m
Zoltan Somogyi d710c436f0 Fix quoting of attributes in type defns.
This fixes Mantis bug #545.

compiler/parse_tree_out.m:
    Put brackets around functor names in "where direct_arg is" attributes.

compiler/mercury_to_mercury.m:
    Provide a function for doing that.

tests/valid_seq/xml_event_read.m:
tests/valid_seq/xml_event_read_helper.m:
    A slightly modified version of the Mantis test case.

tests/valid_seq/Mmakefile:
tests/valid_seq/Mercury.options:
    Enable the new test case, and compile it with intermodule optimization
    to (try to) tickle the bug.
2022-02-09 19:46:05 +11:00

29 lines
745 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%---------------------------------------------------------------------------%
:- module xml_event_read_helper.
:- interface.
:- type event_or_eof.
:- func get_value(string) = event_or_eof.
:- implementation.
get_value(S) = event(current_and_next_event(data(S), next_event_unknown_yet)).
:- type content_event
---> data(string).
:- type maybe_next_event
---> etag_past_empty_elem_tag(string)
; next_event_unknown_yet.
:- type current_and_next_event
---> current_and_next_event(content_event, maybe_next_event).
:- type event_or_eof
---> event(current_and_next_event)
; eof_event.