Fix multiple statements
This commit is contained in:
parent
eda259dfbf
commit
b673f99433
@ -135,37 +135,45 @@ char* compile(tSyntaxElement* syntaxtree) {
|
||||
|
||||
char* result = calloc(1,sizeof(char));
|
||||
|
||||
if (se_istraversable(syntaxtree)) {
|
||||
while (1) {
|
||||
|
||||
if (syntaxtree->content.syntax->type == TOKEN) {
|
||||
if (se_istraversable(syntaxtree)) {
|
||||
|
||||
tSyntaxElement* token = syntaxtree->content.syntax;
|
||||
if (syntaxtree->content.syntax->type == TOKEN) {
|
||||
|
||||
if (strcmp(token->content.string, "def") == 0) {
|
||||
} else
|
||||
tSyntaxElement* token = syntaxtree->content.syntax;
|
||||
|
||||
if (strcmp(token->content.string, "set") == 0) {
|
||||
if (strcmp(token->content.string, "def") == 0) {
|
||||
} else
|
||||
|
||||
compile_enter_tag(&result);
|
||||
if (strcmp(token->content.string, "set") == 0) {
|
||||
|
||||
string_append(&result, "set ");
|
||||
string_append(&result,token->next->content.string);
|
||||
string_append(&result,"=");
|
||||
string_append(&result,compile_expression(token->next->next));
|
||||
compile_enter_tag(&result);
|
||||
|
||||
compile_exit_tag(&result);
|
||||
string_append(&result, "set ");
|
||||
string_append(&result,token->next->content.string);
|
||||
string_append(&result,"=");
|
||||
string_append(&result,compile_expression(token->next->next));
|
||||
|
||||
} else
|
||||
compile_exit_tag(&result);
|
||||
|
||||
if (strcmp(token->content.string, "print") == 0) {
|
||||
} else
|
||||
|
||||
string_append(&result, "{{");
|
||||
string_append(&result,compile_expression(token->next));
|
||||
string_append(&result, "}}");
|
||||
if (strcmp(token->content.string, "print") == 0) {
|
||||
|
||||
string_append(&result, "{{");
|
||||
string_append(&result,compile_expression(token->next));
|
||||
string_append(&result, "}}");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (syntaxtree->next != NULL)
|
||||
syntaxtree = syntaxtree->next;
|
||||
else break;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user