Spaces:
Sleeping
Sleeping
Download samples/errors.cl from Kacemath/cl-compiler: direct link, hf CLI and curl.
- Browser
- Download file 461 Bytes
-
https://huggingface.co/spaces/Kacemath/cl-compiler/resolve/main/samples/errors.cl
- Command line
-
hf download hf://spaces/Kacemath/cl-compiler/samples/errors.cl
-
curl -L -o errors.cl https://huggingface.co/spaces/Kacemath/cl-compiler/resolve/main/samples/errors.cl
461 Bytes
| // errors.cl — Program with intentional semantic errors (for testing Milestone 3) | |
| // | |
| // This file should FAIL semantic analysis. | |
| // Run: python compiler.py samples/errors.cl --phase semantic | |
| // | |
| // Error 1 (line 7): Type mismatch — assigning a string to an int variable | |
| // Error 2 (line 10): Undeclared variable 'z' used in expression | |
| int x; | |
| x = "hello"; // ERROR: 'x' is int, cannot assign string | |
| int y; | |
| y = z + 1; // ERROR: 'z' was never declared | |