Skip to content

Commit

Permalink
Fixed #107
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsf committed Mar 30, 2020
1 parent b3ccea6 commit 7944f5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ string listfile="";
* Version
*/

string compiler_version = "v2.3.01";
string compiler_version = "v2.3.02";

/**
* Application entry point
Expand Down
11 changes: 6 additions & 5 deletions source/program.d
Original file line number Diff line number Diff line change
Expand Up @@ -621,16 +621,17 @@ class Program
if(pass == 1) {
// Check if within procedure
if(has_statement) {
if(statements.children[0].children[0].name == "XCBASIC.Proc_stmt") {
ParseTree statement_kw = statements.children[0].children[0];
if(statement_kw.name == "XCBASIC.Proc_stmt" || statement_kw.name == "XCBASIC.Fun_stmt") {
this.in_procedure = true;
this.current_proc_name = join(statements.children[0].children[0].children[0].matches);
}
else if(statements.children[0].children[0].name == "XCBASIC.Endproc_stmt") {
else if(statement_kw.name == "XCBASIC.Endproc_stmt" || statement_kw.name == "XCBASIC.Endfun_stmt") {
this.in_procedure = false;
this.current_proc_name = "";
}
// line has statement and it's a DATA statement
if(statements.children[0].children[0].name == "XCBASIC.Data_stmt") {
if(statement_kw.name == "XCBASIC.Data_stmt") {
Stmt stmt = StmtFactory(statements.children[0], this);
stmt.process();
}
Expand Down Expand Up @@ -701,11 +702,11 @@ class Program

if(child.children.length > 1) {
auto Stmt = child.children[1].children[0].children[0];
if(Stmt.name == "XCBASIC.Proc_stmt") {
if(Stmt.name == "XCBASIC.Proc_stmt" || Stmt.name == "XCBASIC.Fun_stmt") {
this.in_procedure = true;
this.current_proc_name = join(Stmt.children[0].matches);
}
else if(Stmt.name == "XCBASIC.Endproc_stmt") {
else if(Stmt.name == "XCBASIC.Endproc_stmt" || Stmt.name == "XCBASIC.Endfun_stmt") {
this.in_procedure = false;
this.current_proc_name = "";
}
Expand Down

0 comments on commit 7944f5a

Please sign in to comment.