Skip to content

Error checking #2

Open
Open
@bansheerubber

Description

@bansheerubber

error checking can be accomplished by figuring out if a particular expression is supposed to be in a specific location or not. for instance, operators or literals cannot not have a parent that is a code block. an if statement or a function declaration cannot have a parent that is a variable assignment. doing those sorts of checks should reduce the amount of errors that we pass to .cs files.

additionally, some error messages are vague and unhelpful. if you do something like:

for(%i = 0; %i < 50; %i++) 
      %hey += %i;
}

then you may get an EOF error, which doesn't make too much sense. additionally, it'll give you an incorrect line number and character number for the source of the error too, further confusing things.

i was thinking of being lazy and having torquescript do all of the hard work, but the program really should be able to detect things on its own. error checking is so lacking right now that

%variable = someMethod();
else {
      echo("hey");
}

is treated as entirely correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Error checking · Issue #2 · bansheerubber/eggscript