[Mono-bugs] [Bug 61604][Nor] New - inside undefined #define, #line directive inside namespace is regarded as CS0116

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 15 Jul 2004 11:06:55 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=61604

--- shadow/61604	2004-07-15 11:06:55.000000000 -0400
+++ shadow/61604.tmp.11046	2004-07-15 11:06:55.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 61604
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: inside undefined #define, #line directive inside namespace is regarded as CS0116
+
+This example code does not result in tokenization error under MS csc, while
+mcs reports CS0116:
+
+---------------------
+#if NET_2_0
+
+namespace NS1
+{
+        public class Test
+        {
+#line 1 "foo.cs"
+                public void Foo ()
+                {
+                }
+        }
+#endif
+---------------------
+
+
+_@r50 ~/tests/mcs-bugs
+$ mcs define-line.cs
+foo.cs(3) error CS0116: A namespace can only contain types and namespace
+declarations
+syntax error, got token `CLOSE_BRACE', expecting end-of-file EOF ABSTRACT
+BOOL BYTE CHAR CLASS DECIMAL DELEGATE DOUBLE ENUM EXTERN FLOAT INT
+INTERFACE INTERNAL LONG NAMESPACE NEW OBJECT OVERRIDE PRIVATE PROTECTED
+PUBLIC READONLY SBYTE SEALED SHORT STATIC STRING STRUCT UINT ULONG UNSAFE
+USHORT USING VIRTUAL VOID VOLATILE OPEN_BRACKET IDENTIFIER
+Mono.CSharp.yyParser.yyException: irrecoverable syntax error
+in <0x00834> Mono.CSharp.CSharpParser:yyparse (Mono.CSharp.yyParser.yyInput)
+in <0x00066> Mono.CSharp.CSharpParser:parse ()
+
+foo.cs(4) error CS8025: Parsing error
+Compilation failed: 2 error(s), 0 warnings
+
+
+
+How often does this happen? 
+- always.
+
+Additional Information:
+
+- This matters when you are using jay with #if NET_2_0