[nem-bug] [Nemerle 0000756]: 'Internal compiler error' if try use
closures in yield-method
feedback at nemerle.org
feedback at nemerle.org
Sat Sep 16 03:16:58 CEST 2006
The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=756>
======================================================================
Reported By: VladD2
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 756
Category: Compiler
Reproducibility: always
Severity: minor
Priority: high
Status: new
======================================================================
Date Submitted: 09-16-2006 03:16 CEST
Last Modified: 09-16-2006 03:16 CEST
======================================================================
Summary: 'Internal compiler error' if try use closures in
yield-method
Description:
using System;
variant Token
{
| Number { val : double; }
| LeftBracket //{ tokens : list[Token] }
| RightBracket
| Plus
| Minus
| Mul
| Div
| Eof
}
module Program
{
Main() : void { }
GetToken(text : string) : System.Collections.Generic.IEnumerator[Token]
{
mutable i = 0;
def peek() { if (text.Length == i) '\0' else text[i] }
def next() { i++; peek() }
def getNumber(ch) { if (char.IsDigit(peek())) { ch.ToString() +
getNumber(next()) } else ch.ToString() }
def scan(ch : char) : Token
{
| '+' => Token.Plus()
| '-' => Token.Minus()
| '/' => Token.Div()
| '*' => Token.Mul()
| '(' => Token.LeftBracket()
| ')' => Token.RightBracket()
| ' ' | '\t' | '\r' | '\n' => scan(next())
| '\0' => Token.Eof()
| ch when char.IsDigit(ch) =>
Token.Number(double.Parse(getNumber(ch)))
}
yield scan(next());
}
}
-----------------------------------------
internal compiler error: assertion ``False'' failed in file
ncc\generation\Typer3.n, line 445
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
09-16-06 03:16 VladD2 New Issue
======================================================================
More information about the bugs
mailing list