Bug 9559 - Mono MCS has trouble with a file where a line ends in <number>\r\r\n
Summary: Mono MCS has trouble with a file where a line ends in <number>\r\r\n
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2013-01-14 17:15 UTC by Brett van Swelm
Modified: 2013-01-16 11:13 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Brett van Swelm 2013-01-14 17:15:24 UTC
Mono MCS has trouble with a file where a line ends in <number>\r\r\n.

With "D:\Applications\Mono-2.11.4\bin" and
"C:\Windows\Microsoft.NET\Framework\v4.0.30319" in the path on my Windows 7

===== LineEnding.cs =====
public class Test
    void test()
        // The following line MUST end in '\r\r\n':
        int i = 1

===== end =====

$ csc /target:library LineEnding.cs
Microsoft (R) Visual C# Compiler version 4.0.30319.17929
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.

$ mcs /target:library LineEnding.cs
LineEnding.cs(7,0): error CS0589: Internal compiler error during parsingMono.CSharp.InternalErrorException: Second] putting back [
] is not allowed
  at Mono.CSharp.Tokenizer.putback (Int32 c) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Tokenizer.is_number (Int32 c) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Tokenizer.xtoken () [0x00000] in <filename unknown>:0
  at Mono.CSharp.Tokenizer.token () [0x00000] in <filename unknown>:0
  at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] in <filename unknown>:0
  at Mono.CSharp.CSharpParser.parse () [0x00000] in <filename unknown>:0
Compilation failed: 1 error(s), 0 warnings


Brett van Swelm | Senior Engineer
Coverity | 185 Berry Street | Suite 6500, Lobby 3 | San Francisco, CA 94107
The Leader in Development Testing
Read our profile in Forbes, Coverity Gets Code Right 25% Faster
Comment 1 Marek Safar 2013-01-16 11:13:41 UTC
Fixed in master