[nem-bug] [Nemerle 0000685]: Parser gets confused with method attributes when compiling with indentation syntax

feedback at nemerle.org feedback at nemerle.org
Sun Jul 9 14:29:23 CEST 2006


The following issue has been CLOSED
======================================================================
<http://nemerle.org/bugs/view.php?id=685> 
======================================================================
Reported By:                mark
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   685
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
======================================================================
Date Submitted:             05-25-2006 20:52 CEST
Last Modified:              07-09-2006 14:29 CEST
======================================================================
Summary:                    Parser gets confused with method attributes when
compiling with indentation syntax
Description: 
using System
using System.Console


class Tester 
	mutable an_int : int

	public this (i : int) 
		this.an_int = i

	[STAThread]
	public static Main () : void 
		def t = Tester(1);
		WriteLine (t.an_int);

This doesn't compile and errors with:

python-test.n:11:2:11:11: error: parse error near identifier `STAThread':
unexpected end of token sequence
python-test.n:11:2:11:11: error: parse error near separator or closing
bracket: expecting type declaration


While the following compiles

using System;
using System.Console;


class Tester {
	mutable an_int : int;

	public this (i : int) {
		this.an_int = i;
	}

	[STAThread]
	public static Main () : void {
		def t = Tester(1);
		WriteLine (t.an_int);
	}
}


======================================================================

----------------------------------------------------------------------
 nazgul - 05-25-06 20:58 
----------------------------------------------------------------------
This is by design. See http://nemerle.org/Indentation-based_syntax

Use 
[Attr] public foo () : void
  ()

or

[Attr] \
public foo () : void
  ()

----------------------------------------------------------------------
 nazgul - 07-09-06 14:29 
----------------------------------------------------------------------
By design.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
05-25-06 20:52 mark           New Issue                                    
05-25-06 20:58 nazgul         Note Added: 0001320                          
07-09-06 14:29 nazgul         Status                   new => closed       
07-09-06 14:29 nazgul         Note Added: 0001356                          
======================================================================




More information about the bugs mailing list