Commit 036f54ad authored by Luke  Thorpe's avatar Luke Thorpe
Browse files

Corrected technical errors in answer to 'Gap 1'

parent 7c87d969
No preview for this file type
......@@ -303,9 +303,7 @@ The statement must be given a valid WACC type \synt{type}, a variable name \synt
The initial assignment to a variable follows all of the assignment restrictions discussed in detail in the assignment statement section below.
A variable must be declared before \hl{they can be accessed. TODO: Is this what they want?}
Any attempt to access an undeclared variable results in \hl{a syntax error during compilation.}
A variable must be declared before \hl{it can be referenced within the given scope;} any attempt to access an undeclared variable results in \hl{a semantic error during compilation.}
Additionally, every use of a variable must match the type assigned to that variable when it was declared.
......
# assignment to variable not declared in current scope
# Output:
# #semantic_error#
# Exit:
# 200
# Program:
begin
begin
x = 10 ;
int x = 5
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment