[COMPILER]

* NEW: The Begins and Ends operator of course.
* BUG: Fix a crash when compiling a line beginning with the Read instruction.


git-svn-id: svn://localhost/gambas/trunk@2366 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2009-09-27 10:34:39 +00:00
parent c17951fcd3
commit d35c59c763
4 changed files with 21 additions and 4 deletions

View file

@ -1,5 +1,5 @@
# Gambas Project File 3.0
# Compiled with Gambas 2.99.0 (r2317)
# Compiled with Gambas 2.99.0 (r2352)
Title=Gambas documentation CGI script
Startup=Main
Icon=help.png

View file

@ -982,7 +982,7 @@ Private Function Encode(sText As String) As String
$sRes &= GetVersion()
Continue
Case "only-in"
Case "only-in", "only"
$sRes &= GetOnlyIn(sArg)
Continue

View file

@ -550,7 +550,9 @@ static void add_identifier(bool no_res)
last_type = (flag & RSF_ILT) != 0;
if (flag & RSF_ILDD)
{
if (RES_get_ident_flag(PATTERN_index(get_last_last_pattern())) & RSF_ILD)
PATTERN last_last_pattern = get_last_last_pattern();
if (PATTERN_is_reserved(last_last_pattern) && RES_get_ident_flag(PATTERN_index(last_last_pattern)) & RSF_ILD)
last_declare = TRUE;
flag &= ~RSF_ILDD; // flag == 0 means we can read a subroutine!
}

View file

@ -234,6 +234,14 @@ static void add_pattern(int type, int index)
#endif
static PATTERN get_last_last_pattern()
{
if (EVAL->pattern_count > 1)
return EVAL->pattern[EVAL->pattern_count - 2];
else
return NULL_PATTERN;
}
static PATTERN get_last_pattern()
{
if (EVAL->pattern_count > 0)
@ -446,7 +454,14 @@ static void add_identifier(bool no_res)
last_func = (flag & RSF_ILF) != 0;
last_declare = (flag & RSF_ILD) != 0;
last_type = (flag & RSF_ILT) != 0;
//last_event = flag & RSF_ILE;
if (flag & RSF_ILDD)
{
PATTERN last_last_pattern = get_last_last_pattern();
if (PATTERN_is_reserved(last_last_pattern) && RES_get_ident_flag(PATTERN_index(last_last_pattern)) & RSF_ILD)
last_declare = TRUE;
flag &= ~RSF_ILDD; // flag == 0 means we can read a subroutine!
}
}
else
{