From e1208fc7adffee90f61374d83c84c7f78aecf4c3 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 13 Sep 2013 10:52:52 +0100 Subject: [PATCH] fix () extension --- C/scanner.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/C/scanner.c b/C/scanner.c index f51388f8a..b1c1149ef 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -1306,9 +1306,18 @@ Yap_tokenizer(IOSTREAM *inp_stream, int store_comments, Term *tposp) och = ch; ch = getchr(inp_stream); t->TokInfo = och; - if (t->TokInfo == '(' && !solo_flag) { - t->TokInfo = 'l'; - solo_flag = TRUE; + if (och == '(') { + while (chtype(ch) == BS) { ch = getchr(inp_stream); }; + if (ch == ')') { + t->TokInfo = Unsigned(AtomEmptyBrackets); + t->Tok = Ord(kind = Name_tok); + ch = getchr(inp_stream); + solo_flag = FALSE; + break; + } else if (!solo_flag) { + t->TokInfo = 'l'; + solo_flag = TRUE; + } } else if (och == '[') { while (chtype(ch) == BS) { ch = getchr(inp_stream); }; if (ch == ']') {