File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ let execute lexbuf verbose =
5
5
let ast = compilationUnit Lexer. token lexbuf in
6
6
print_endline " successfull parsing" ;
7
7
8
- (* if verbose then AST.print_program ast;
8
+ if verbose then AST. print_program ast;
9
9
print_endline " ===================" ;
10
10
Typing. typing ast;
11
11
if verbose then AST. print_program ast;
12
- print_endline "successfull typing";*)
12
+ print_endline " successfull typing" ;
13
13
Compilation. compileAST ast;
14
14
print_endline " compile successfull" ;
15
15
Original file line number Diff line number Diff line change @@ -180,7 +180,11 @@ let rec verify_expression env current_env e =
180
180
e.etype < - verify_name s env current_env
181
181
| ArrayInit el -> () (* TODO*)
182
182
| Array (e ,el ) -> () (* TODO*)
183
- | AssignExp (e1 ,op ,e2 ) -> () (* TODO*)
183
+ | AssignExp (e1 ,op ,e2 ) ->
184
+ verify_expression env current_env e1;
185
+ verify_expression env current_env e2;
186
+ verify_assignop_type e1.etype e2.etype;
187
+ e.etype < - e1.etype
184
188
| Post (e ,op ) -> () (* TODO*)
185
189
| Pre (op ,e ) -> () (* TODO*)
186
190
| Op (e1 ,op ,e2 ) ->
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public I(int e) {
14
14
String mystring2 = func1 (i );
15
15
private String func1 (int a ) {
16
16
int b = 1 ;
17
+ b += (5 +4 );
17
18
return "YES" ;
18
19
}
19
20
You can’t perform that action at this time.
0 commit comments