* lisp/progmodes/opascal.el: Allow inline var decl in for (bug#36348)

(opascal-enclosing-indent-of): Ignore decls "neutered" by delimiter.
This commit is contained in:
Stefan Monnier 2019-07-22 13:10:35 -04:00
parent d0eeb62c43
commit 87ad8a1143
2 changed files with 17 additions and 2 deletions

View file

@ -1177,8 +1177,11 @@ routine.")
(throw 'done (opascal-stmt-line-indent-of
(or last-token token) opascal-indent-level)))
;; We indent relative to an enclosing declaration section.
((opascal-is token-kind opascal-decl-sections)
;; We indent relative to an enclosing declaration section,
;; unless this is within the a delimited expression
;; (bug#36348).
((and (not expr-delimited)
(opascal-is token-kind opascal-decl-sections))
(throw 'done (opascal-indent-of (if last-token last-token token)
opascal-indent-level)))

View file

@ -0,0 +1,12 @@
{ -*- opascal -*- }
procedure Toto ();
begin
for i := 0 to 1 do
Write (str.Chars[i]);
// bug#36348
for var i := 0 to 1 do
Write (str.Chars[i]);
end;