mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 11:23:46 +00:00
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
45 lines
882 B
Mathematica
45 lines
882 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
:- module prince_frameopt_css.
|
|
|
|
:- interface.
|
|
|
|
:- import_module int.
|
|
:- import_module float.
|
|
:- import_module string.
|
|
|
|
:- include_module prince_frameopt_css.style.
|
|
|
|
:- type length
|
|
---> absolute(float).
|
|
|
|
:- type value
|
|
---> ident(string)
|
|
; percent(number).
|
|
|
|
:- type number
|
|
---> int(int)
|
|
; float(float).
|
|
|
|
:- func get_length(value) = length is det.
|
|
:- func get_percent(value) = float is semidet.
|
|
|
|
:- implementation.
|
|
|
|
get_length(V) = L :-
|
|
( if V = ident("zero") then
|
|
L = absolute(0.0)
|
|
else
|
|
L = absolute(1.0)
|
|
).
|
|
|
|
get_percent(percent(N0)) = N :-
|
|
(
|
|
N0 = int(N1),
|
|
N = float(N1)
|
|
;
|
|
N0 = float(N)
|
|
).
|