[svn] r6791: nemerle/trunk/ncc/parsing: MainParser.n PreParser.n
VladD2
svnadmin at nemerle.org
Thu Oct 26 14:10:44 CEST 2006
Log:
Fix ParseExpr().
Author: VladD2
Date: Thu Oct 26 14:10:43 2006
New Revision: 6791
Modified:
nemerle/trunk/ncc/parsing/MainParser.n
nemerle/trunk/ncc/parsing/PreParser.n
Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n (original)
+++ nemerle/trunk/ncc/parsing/MainParser.n Thu Oct 26 14:10:43 2006
@@ -157,7 +157,7 @@
[NotNull] funHeader : Fun_header
) : PExpr
{
- def preparser = PreParser (lexer);
+ def preparser = PreParser (lexer, env);
def tokens = preparser.PreParse ();
def parser = MainParser (env);
@@ -791,6 +791,7 @@
match (peek_token ()) {
| Token.BracesGroup as brac =>
shift ();
+
loc += brac.Location;
// we skip body parsing in completion mode,
// to save time and ignore errors
@@ -1631,8 +1632,9 @@
mutable _op_context = OpContext.Prefix;
def loop () {
- if (_op_context == OpContext.Prefix)
- match (peek_token ()) {
+ if (_op_context == OpContext.Prefix) {
+ def tok = peek_token ();
+ match (tok) {
| Token.Operator ("..") =>
shift ();
def expr = parse_spliced_expr ();
@@ -1680,6 +1682,7 @@
_op_context = OpContext.Postfix;
loop ()
}
+ }
else {
mutable group = null : Token;
def info =
Modified: nemerle/trunk/ncc/parsing/PreParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/PreParser.n (original)
+++ nemerle/trunk/ncc/parsing/PreParser.n Thu Oct 26 14:10:43 2006
@@ -83,6 +83,12 @@
lexer = lex;
}
+ public this (lex : LexerBase, env : GlobalEnv) {
+ Env = env;
+ lex.Keywords = Env.Keywords;
+ lexer = lex;
+ }
+
reset_comment (tok : Token) : void {
when (doc_comments != null) doc_comments = doc_comments.Replace (tok.Location, "");
}
More information about the svn
mailing list