Mercurial > urweb
comparison src/elisp/urweb-mode.el @ 1502:2f9b7382dd1d
First tutorial chapter ready
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 16 Jul 2011 14:12:14 -0400 |
parents | 0b639858200b |
children | 3c0803c1acd7 |
comparison
equal
deleted
inserted
replaced
1501:841b08995259 | 1502:2f9b7382dd1d |
---|---|
168 (let ( | 168 (let ( |
169 (depth 0) | 169 (depth 0) |
170 (finished nil) | 170 (finished nil) |
171 (answer nil) | 171 (answer nil) |
172 ) | 172 ) |
173 (while (and (not finished) (re-search-backward "[<>{}]" nil t)) | 173 (while (and (not finished) (re-search-backward "[<>{}]|\\*\)" nil t)) |
174 (cond | 174 (cond |
175 ((looking-at "*)") | |
176 (search-backward "(*")) | |
175 ((looking-at "{") | 177 ((looking-at "{") |
176 (if (> depth 0) | 178 (if (> depth 0) |
177 (decf depth) | 179 (decf depth) |
178 (setq finished t))) | 180 (setq finished t))) |
179 ((looking-at "}") | 181 ((looking-at "}") |
181 ((save-excursion (backward-char 1) (or (looking-at "=>") | 183 ((save-excursion (backward-char 1) (or (looking-at "=>") |
182 (looking-at "->") | 184 (looking-at "->") |
183 (looking-at "<>"))) | 185 (looking-at "<>"))) |
184 (setq finished t)) | 186 (setq finished t)) |
185 ((or (looking-at "< ") (looking-at "<=")) | 187 ((or (looking-at "< ") (looking-at "<=")) |
186 nil) | 188 (setq finished t)) |
187 ((looking-at "<") | 189 ((looking-at "<") |
188 (setq finished t)) | 190 (setq finished t)) |
189 ((looking-at ">") | 191 ((looking-at ">") |
190 (cond | 192 (cond |
191 ((> depth 0) | 193 ((> depth 0) |