# Source file name of 'mismatched indentations' warning in ruby 1.9

**URL:** <https://www.ruby-forum.com/t/source-file-name-of-mismatched-indentations-warning-in-ruby-1-9/150779>\
**Category:** Development\
**Created:** [October 13, 2008, 9:30am UTC](https://www.ruby-forum.com/t/source-file-name-of-mismatched-indentations-warning-in-ruby-1-9/150779 "2008-10-13T09:30:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![masayoshi\_takahashi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@masayoshi\_takahashi](https://www.ruby-forum.com/u/masayoshi_takahashi)\
**Post date:** [October 13, 2008, 9:30am UTC](https://www.ruby-forum.com/t/source-file-name-of-mismatched-indentations-warning-in-ruby-1-9/150779/1 "2008-10-13T09:30:40Z")

</div>

e$B9b66@,5A$G$9!#e(B

Ruby 1.9e$B$K$O%$%s%G%s%H%l%Y%k$N@09g@-$rD4$Y$F7Y9p$rEG$/$h$&$Ke(B  
e$B$J$C$F$$$k$h$&$G$9$,!"e(Brequiree$B$G%9%/%j%W%H$rFI$\_9~$`:]!"FI$\_9~$^$l$ke(B  
e$BBP\>]$N%U%!%$%k$N%$%s%G%s%H$,$\*$+$7$$\>l9g$G$b!"FI$_9~$_$r9T$&B&$Ne(B  
e$B%9%/%j%W%H$N%U%!%$%kL\>$7$+I=\<($5$l$^$;$s!#e(B

$ ./bin/ruby -w test0.rb  
test0.rb:1: warning: mismatched indentations: line 1:‘class’ and line  
2:‘end’  
$ cat test0.rb  
require ‘test’  
$ cat test.rb  
class Foo  
end

e$BNc$($P\>e5-$N$h$&$J\>l9g!"e(Btest.rbe$B$NL\>A0$bI=\<($5$l$F$[$7$$$N$G$9$,!"e(B  
e$B$=$l$OFq$7$$!Je(Bor e$B$9$k$Y$-$G$O$J$$!K$N$G$7$g$&$+!)e(B

e$B9b66@,5Ae(B (removed\_email\_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![masayoshi\_takahashi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@masayoshi\_takahashi](https://www.ruby-forum.com/u/masayoshi_takahashi)\
**Post date:** [October 13, 2008, 10:17am UTC](https://www.ruby-forum.com/t/source-file-name-of-mismatched-indentations-warning-in-ruby-1-9/150779/2 "2008-10-13T10:17:06Z")

</div>

e$B@.@%$G$9!#e(B

On Mon, 13 Oct 2008 16:27:22 +0900, masayoshi takahashi  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> $ cat test0.rb  
> require ‘test’  
> $ cat test.rb  
> class Foo  
> end
> 
> e$BNc$($P\>e5-$N$h$&$J\>l9g!"e(Btest.rbe$B$NL\>A0$bI=\<($5$l$F$[$7$$$N$G$9$,!"e(B  
> e$B$=$l$OFq$7$$!Je(Bor e$B$9$k$Y$-$G$O$J$$!K$N$G$7$g$&$+!)e(B
> 
> e$B9b66@,5Ae(B (removed\_email\_address@domain.invalid)

# Index: parse.y

— parse.y (revision 19769)  
+++ parse.y (working copy)  
@@ -4856,7 +4856,8 @@ token\_info\_pop(struct parser\_params _parser, const  
if (token\_info\_has\_nonspaces(parser, token) || ptinfo-\>nonspc) {  
/_  
SKIP \*/  
goto finish;  
}

- rb\_warning(“mismatched indentations: line %d:‘%s’ and line  
%d:‘%s’”,

- rb\_compile\_warning(ruby\_sourcefile, 0,
- 

```
          "mismatched indentations: line %d:'%s' and line 

```

%d:‘%s’",  
ptinfo-\>linenum, ptinfo-\>token, linenum, token);

```
finish:

```

e$B$3$s$J46$8$G$9$+$M!#e(B

% ruby19 -w test0.rb  
/home/naruse/test.rb: warning: mismatched indentations: line 1:‘class’  
and  
line 2:‘end’

e$B$3$&$J$j$^$9!#e(B

---

<div class="post-metadata">

**Author:** ![masayoshi\_takahashi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@masayoshi\_takahashi](https://www.ruby-forum.com/u/masayoshi_takahashi)\
**Post date:** [October 13, 2008, 11:33am UTC](https://www.ruby-forum.com/t/source-file-name-of-mismatched-indentations-warning-in-ruby-1-9/150779/3 "2008-10-13T11:33:23Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36711] Re: source file name of ‘mismatched  
indentations’ warning in ruby 1.9”  
on Mon, 13 Oct 2008 17:14:03 +0900, “NARUSE, Yui”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|\> Ruby 1.9e$B$K$O%$%s%G%s%H%l%Y%k$N@09g@-$rD4$Y$F7Y9p$rEG$/$h$&$Ke(B  
|\> e$B$J$C$F$$$k$h$&$G$9$,!"e(Brequiree$B$G%9%/%j%W%H$rFI$\_9~$`:]!"FI$\_9~$^$l$ke(B  
|\> e$BBP\>]$N%U%!%$%k$N%$%s%G%s%H$,$\*$+$7$$\>l9g$G$b!"FI$_9~$_$r9T$&B&$Ne(B  
|\> e$B%9%/%j%W%H$N%U%!%$%kL\>$7$+I=\<($5$l$^$;$s!#e(B

|Index: parse.y  
|===================================================================  
|— parse.y (revision 19769)  
|+++ parse.y (working copy)  
|@@ -4856,7 +4856,8 @@ token\_info\_pop(struct parser\_params _parser, const  
| if (token\_info\_has\_nonspaces(parser, token) || ptinfo-\>nonspc) { /_  
|SKIP \*/  
| goto finish;  
| }  
|- rb\_warning(“mismatched indentations: line %d:‘%s’ and line %d:‘%s’”,  
|+ rb\_compile\_warning(ruby\_sourcefile, 0,  
|+ “mismatched indentations: line %d:‘%s’ and line %d:‘%s’”,  
| ptinfo-\>linenum, ptinfo-\>token, linenum, token);  
|  
| finish:  
|  
|e$B$3$s$J46$8$G$9$+$M!#e(B

e$B%3%\_%C%H$7$F$/$@$5$$!#e(B
