mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 13:23:53 +00:00
Estimated hours taken: 0.5
library/parser.m:
Fix a bug: according to the ISO Prolog standard, it should allow
terms of the form `{}(foo)' or `[](foo)'.
tests/valid/Mmakefile:
tests/valid/parsing_bug.m:
tests/valid/parsing_bug_main.m:
Regression test.
27 lines
393 B
Mathematica
27 lines
393 B
Mathematica
:- module parsing_bug.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list, set.
|
|
|
|
:- func { list(T) } = set(T).
|
|
|
|
:- func (set(T) /\ set(T)) = set(T).
|
|
|
|
:- func (set(T) \/ set(T)) = set(T).
|
|
|
|
:- func (set(T) - set(T)) = set(T).
|
|
|
|
:- implementation.
|
|
|
|
{ List } = Set :- list_to_set(List, Set).
|
|
|
|
A /\ B = C :- set__intersect(A, B, C).
|
|
|
|
A \/ B = C :- set__union(A, B, C).
|
|
|
|
A - B = C :- set__difference(A, B, C).
|
|
|
|
|
|
|