Skip to content
Snippets Groups Projects
Commit bb0708d4 authored by Wilke Pierre's avatar Wilke Pierre
Browse files

fix tests

parent b958071a
No related branches found
No related tags found
No related merge requests found
struct point {
int x;
int y;
};
int scalar_product(struct point p1, struct point p2){
return p1.x * p2.x + p1.y * p2.y;
}
int orthogonal(struct point p1, struct point p2){
return p1.x * p2.y - p1.y * p2.x;
}
int main(){
struct point p1;
struct point p2;
p1.x = 3;
p1.y = 3;
p2.x = -5;
p2.y = 4;
print(scalar_product(p1,p2));
return (orthogonal(p1,p2));
}
{"output": "-3\n", "error": null, "retval": 27}
\ No newline at end of file
{"output": "-3\n", "error": null, "retval": 27}
\ No newline at end of file
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(scalar_product)
SYM_LPARENTHESIS
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_IDENTIFIER(p1)
SYM_COMMA
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_IDENTIFIER(p2)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(p1)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASTERISK
SYM_IDENTIFIER(p2)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_PLUS
SYM_IDENTIFIER(p1)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASTERISK
SYM_IDENTIFIER(p2)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(orthogonal)
SYM_LPARENTHESIS
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_IDENTIFIER(p1)
SYM_COMMA
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_IDENTIFIER(p2)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(p1)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASTERISK
SYM_IDENTIFIER(p2)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_MINUS
SYM_IDENTIFIER(p1)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASTERISK
SYM_IDENTIFIER(p2)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_IDENTIFIER(p1)
SYM_SEMICOLON
SYM_STRUCT
SYM_IDENTIFIER(point)
SYM_IDENTIFIER(p2)
SYM_SEMICOLON
SYM_IDENTIFIER(p1)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_IDENTIFIER(p1)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_IDENTIFIER(p2)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_MINUS
SYM_INTEGER(5)
SYM_SEMICOLON
SYM_IDENTIFIER(p2)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(4)
SYM_SEMICOLON
SYM_IDENTIFIER(print)
SYM_LPARENTHESIS
SYM_IDENTIFIER(scalar_product)
SYM_LPARENTHESIS
SYM_IDENTIFIER(p1)
SYM_COMMA
SYM_IDENTIFIER(p2)
SYM_RPARENTHESIS
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_LPARENTHESIS
SYM_IDENTIFIER(orthogonal)
SYM_LPARENTHESIS
SYM_IDENTIFIER(p1)
SYM_COMMA
SYM_IDENTIFIER(p2)
SYM_RPARENTHESIS
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
......@@ -3,7 +3,7 @@ struct mastruct {
int y;
};
int main(int argc,char* argv[]){
int main(){
struct mastruct S;
S.x = 12;
S.y = 3;
......
{"output": "", "error": null, "retval": 15}
\ No newline at end of file
{"output": "", "error": null, "retval": 15}
\ No newline at end of file
SYM_STRUCT
SYM_IDENTIFIER(mastruct)
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_STRUCT
SYM_IDENTIFIER(mastruct)
SYM_IDENTIFIER(S)
SYM_SEMICOLON
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(12)
SYM_SEMICOLON
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RETURN
SYM_LPARENTHESIS
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_PLUS
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
......@@ -3,7 +3,7 @@ struct mastruct {
int y;
};
int main(int argc,char* argv[]){
int main(){
struct mastruct S;
struct mastruct T;
S.x = 12;
......
{"output": "", "error": null, "retval": 15}
\ No newline at end of file
{"output": "", "error": null, "retval": 15}
\ No newline at end of file
SYM_STRUCT
SYM_IDENTIFIER(mastruct)
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_STRUCT
SYM_IDENTIFIER(mastruct)
SYM_IDENTIFIER(S)
SYM_SEMICOLON
SYM_STRUCT
SYM_IDENTIFIER(mastruct)
SYM_IDENTIFIER(T)
SYM_SEMICOLON
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(12)
SYM_SEMICOLON
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_IDENTIFIER(T)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(14)
SYM_SEMICOLON
SYM_IDENTIFIER(T)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(15)
SYM_SEMICOLON
SYM_RETURN
SYM_LPARENTHESIS
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(x)
SYM_PLUS
SYM_IDENTIFIER(S)
SYM_POINT
SYM_IDENTIFIER(y)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment