test
This commit is contained in:
		
							parent
							
								
									4d191dd16f
								
							
						
					
					
						commit
						6d52628c9b
					
				
							
								
								
									
										10
									
								
								a1/program.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								a1/program.c
									
									
									
									
									
								
							| @ -75,13 +75,13 @@ void skontrolujZatvorky(const char *kod) { | ||||
|             vloz(&z, aktualny); | ||||
|         } else if (aktualny == '}' || aktualny == ']' || aktualny == '>' || aktualny == ')') { | ||||
|             if (jePrazdny(&z)) { | ||||
|                 printf("Unexpected closing bracket %c in %d\n", aktualny, pozicia); | ||||
|                 printf("Unexpected closing bracket '%c' in %d\n", aktualny, pozicia); | ||||
|                 return; | ||||
|             } | ||||
| 
 | ||||
|             char poslednaOtvaracia = vyber(&z); | ||||
|             if (!suZosuladene(poslednaOtvaracia, aktualny)) { | ||||
|                 printf("Crossed bracket %c at position %d, expected '%c'\n",  | ||||
|                 printf("Crossed bracket '%c' at position %d, expected '%c'\n",  | ||||
|                        aktualny, pozicia,  | ||||
|                        (poslednaOtvaracia == '{') ? '}' :  | ||||
|                        (poslednaOtvaracia == '[') ? ']' :  | ||||
| @ -92,7 +92,11 @@ void skontrolujZatvorky(const char *kod) { | ||||
|     } | ||||
| 
 | ||||
|     if (!jePrazdny(&z)) { | ||||
|         printf("Unexpected end of input, unmatched '%c'\n", vyber(&z)); | ||||
|         char nezodpovedajuca = vyber(&z);   | ||||
|         printf("Chýbajúce zatváracie zátvorky pre nezodpovedajúcu: %c\n",  | ||||
|                (nezodpovedajuca == '{') ? '}' :  | ||||
|                (nezodpovedajuca == '[') ? ']' :  | ||||
|                (nezodpovedajuca == '<') ? '>' : ')'); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user