Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error checking #2

Open
bansheerubber opened this issue Aug 31, 2020 · 0 comments
Open

Error checking #2

bansheerubber opened this issue Aug 31, 2020 · 0 comments
Labels
Milestone

Comments

@bansheerubber
Copy link
Owner

bansheerubber commented Aug 31, 2020

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.

bansheerubber added a commit that referenced this issue Sep 1, 2020
@bansheerubber bansheerubber added this to the 1.0 milestone Sep 15, 2020
bansheerubber added a commit that referenced this issue Sep 15, 2020
#2. fixed incorrect line/character readout. also color the errors something cool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant