aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Monnier2015-09-29 23:28:32 -0400
committerStefan Monnier2015-09-29 23:28:32 -0400
commite1877439d889e5584dabfd769338367f186e0741 (patch)
treed95a7ebd31869c1bad402739b1d8de043f722ce7 /test
parent300bce3a09da12396a1a686f20ac16acefe80cbc (diff)
downloademacs-e1877439d889e5584dabfd769338367f186e0741.tar.gz
emacs-e1877439d889e5584dabfd769338367f186e0741.zip
* lisp/progmodes/prolog.el: Fix various indentation cases
(prolog-operator-chars): New const (add \\). (prolog-smie-forward-token, prolog-smie-backward-token): Use it. (prolog-smie-rules): Add rules according to bug#21526.
Diffstat (limited to 'test')
-rw-r--r--test/indent/prolog.prolog52
1 files changed, 39 insertions, 13 deletions
diff --git a/test/indent/prolog.prolog b/test/indent/prolog.prolog
index 6bf9437b883..9ac6df1b6c7 100644
--- a/test/indent/prolog.prolog
+++ b/test/indent/prolog.prolog
@@ -1,16 +1,18 @@
1%% -*- mode: prolog; coding: utf-8; fill-column: 78 -*- 1%% -*- mode: prolog; coding: utf-8; fill-column: 78 -*-
2 2
3%% bug#21526 3%% bug#21526
4test1 :- 4test21526_1 :-
5 ( a -> 5 ( a ->
6 ( a -> 6 ( a ->
7 b 7 b
8 ; c 8 ; c
9 ) 9 )
10 ; c 10 ; % Toto
11 c ->
12 d
11 ). 13 ).
12 14
13test2 :- 15test21526_2 :-
14 ( a 16 ( a
15 -> ( a, 17 -> ( a,
16 b 18 b
@@ -19,7 +21,31 @@ test2 :-
19 b2 21 b2
20 ; c1, 22 ; c1,
21 c2 23 c2
22 ) 24 ).
25
26test21526_3 :-
27 X \= Y,
28 \+ a,
29 b,
30 \+ \+ c,
31 d.
32
33test21526_4 :-
34 ( \+ a ->
35 b
36 ; \+ c,
37 \+ d
38 ).
39
40
41test21526_5 :-
42 (a;
43 b ->
44 c).
45
46test21526_predicate(c) :- !,
47 test_goal1,
48 test_goal2.
23 49
24%% Testing correct tokenizing. 50%% Testing correct tokenizing.
25foo(X) :- 0'= = X. 51foo(X) :- 0'= = X.
@@ -74,11 +100,11 @@ subst(X, V, FV, lambda(Y, Ti, Bi), lambda(Y1, To, Bo)) :-
74 %% If X is equal to Y, X is shadowed, so no subst can take place. 100 %% If X is equal to Y, X is shadowed, so no subst can take place.
75 -> Y1 = Y, Bo = Bi 101 -> Y1 = Y, Bo = Bi
76 ; (member((Y, _), FV) 102 ; (member((Y, _), FV)
77 %% If Y appears in FV, it can appear in V, so we need to 103 %% If Y appears in FV, it can appear in V, so we need to
78 %% rename it to avoid name capture. 104 %% rename it to avoid name capture.
79 -> new_atom(Y, Y1), 105 -> new_atom(Y, Y1),
80 subst(Y, Y1, [], Bi, Bi1) 106 subst(Y, Y1, [], Bi, Bi1)
81 ; Y1 = Y, Bi1 = Bi), 107 ; Y1 = Y, Bi1 = Bi),
82 %% Perform substitution on the body. 108 %% Perform substitution on the body.
83 subst(X, V, FV, Bi1, Bo) 109 subst(X, V, FV, Bi1, Bo)
84 ). 110 ).