Commit Graph

943 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 87ebae209e Added 'simple_pointer_cast_le.t' to Emit tests 2023-04-14 15:06:36 +02:00
Tristan B. Velloza Kildaire 39f3980526 Test cases
- Update `simple_pointer_cast_le.t` to do some pointer airthmetic at the byte-level of the 32-bit integer

DGen

- Updated the semantic test code generation for `simple_pointer_cast_le.t` to check for new values
2023-04-14 15:03:23 +02:00
Tristan B. Velloza Kildaire 98a0246ad2 Test cases
- Removed `simple_pointer_cast.t` and replace it with `simple_pointer_cast_le.t` which casts the integer pointer to a byte pointer and sets the lowest significant byte (little endian hence at base of integer) to `2+2`

DGen

- Added semantic test for `simple_pointer_cast_le.t`
2023-04-14 14:53:19 +02:00
Tristan B. Velloza Kildaire 180db482f8 Test cases
- Removed coercion usage, I am only testing the casting here (explicit)
2023-04-14 13:47:59 +02:00
Tristan B. Velloza Kildaire 3fc24a79cc Test cases
- Removed `simple_cast_complex_type.t` as it is wrong, syntax wise
2023-04-14 13:44:59 +02:00
Tristan B. Velloza Kildaire bd6429969f Merge branch 'vardec_varass_dependency' into pointers 2023-04-14 13:41:19 +02:00
Tristan B. Velloza Kildaire 814f595cd5
Casting improvement (#3)
* d

* Removed placeholder

* Parser

- Added a new default parameter to `parseTypedDeclaration()` which is `onlyType=false`. If one sets this to `true` then we will parse the type till the identifier (what would be it) but stopping on the identifier and returning a bogus `TypedEntity` with a fake name string but with the type string intact
- `parseCast()` now uses `parseTypedDeclaration(onlyType=true)` - this should help us when we want to cast for arrays or pointers (where all that logic is in `parseTypedDeclaration()`).

Test cases

- Added a complex `cast(<expr>)` with a pointer - this should work in upstream `pointers` branch
- File name is `simple_cast_complex_type.t`
2023-04-14 13:38:44 +02:00
Tristan B. Velloza Kildaire 1183a94c58 Parser
- Added a TODO - we need a `parseType()`
2023-04-14 12:53:21 +02:00
Tristan B. Velloza Kildaire 6611cb4593 Test cases
- Added `simple_pointer_cast.t` to test casting (currently broken parsing-wise)

DGen

- Added a todo for semantic tests for the `simple_pointer_cast.t` test case
2023-04-14 12:52:59 +02:00
Tristan B. Velloza Kildaire d58e5aad4d DGen
- When emitting for `PointerDereferenceAssignmentInstruction` we didn't wrap `<expr>` with `()`. So instead of `*(<expre>)` we got `*<expr>` which doesn't work if you're doing pointer arithmetic
2023-04-13 14:10:26 +02:00
Tristan B. Velloza Kildaire b5e8ba0b31 Typechecker
- When handling `BinaryOperatorExpression` call `attemptPointerAriehmeticCoercion(Value, Value)` with both `(vLhsInstr, vRhsInstr)` before we call `vLhsInstr.getInstrType()` and `vRhsInstr.getInstrType()` before `isSameType(vLhsType, vRhsType)`. By doing so we attempt to coerce the types of both instructions if one is a pointer and another is an integer, else do nothing
2023-04-13 14:03:56 +02:00
Tristan B. Velloza Kildaire d4fc2904fb Merge branch 'vardec_varass_dependency' into pointers 2023-04-12 11:45:02 +02:00
Tristan B. Velloza Kildaire a346f60c2e Ensure that 'simple_literals4.t' fails as it tests a range violation during coercion 2023-04-12 11:42:21 +02:00
Tristan B. Velloza Kildaire ae038c4182 Ensure 'simple_float_constant_bad.t' passes as a failure as it checks for a bad floating point 2023-04-12 11:38:26 +02:00
Tristan B. Velloza Kildaire a8d244188e Ensure that a failure passes for 'simple_literals2.t' which checks for a failing to coerce due to incompatible types (actually) 2023-04-12 11:36:31 +02:00
Tristan B. Velloza Kildaire e80571758f Ensure that a failure passes for 'simple_literals2.t' which checks for a failing to coerce due to incompatible types 2023-04-12 11:33:34 +02:00
Tristan B. Velloza Kildaire d99b23d64c Disabled 'test3.t' as it is not the focus rn 2023-04-12 09:57:13 +02:00
Tristan B. Velloza Kildaire b4a02addcf Disabled 'simple_oop.t' as it is not the focus rn 2023-04-12 09:55:12 +02:00
Tristan B. Velloza Kildaire 5e298e599b Else without if test case should fail 2023-04-12 09:51:40 +02:00
Tristan B. Velloza Kildaire 6dc3c78792 All collision and precedence checks are failing-positives and should be treated as such 2023-04-12 09:49:08 +02:00
Tristan B. Velloza Kildaire 9ffd3425a0 Removed 'typecheck/simple_array.t' testing as that is old 2023-04-12 09:45:34 +02:00
Tristan B. Velloza Kildaire 8b97531b71 Try to fix falining-positive test case 'simple_function_call_1.t' 2023-04-12 09:42:44 +02:00
Tristan B. Velloza Kildaire 59f8b7c01a Try new technique 2023-04-12 09:39:30 +02:00
Tristan B. Velloza Kildaire ac2fbc86de Allow steps to run even if previous ones failed 2023-04-12 09:33:57 +02:00
Tristan B. Velloza Kildaire fefaa6e434 Renamed test case 2023-04-12 09:31:10 +02:00
Tristan B. Velloza Kildaire a973f60d54 When typechecking 'simple_function_call_1.t' we WANT it to fail, hence exiting with 255 is what we want, anything else is an error 2023-04-12 09:08:56 +02:00
Tristan B. Velloza Kildaire 4144c4accf Fixed emit test for 'Simple conditionals' 2023-04-12 09:04:11 +02:00
Tristan B. Velloza Kildaire 53062f5ebc Commands
- If the `lex`, `syntaxcheck` or `typecheck` commands fail then exit with an exit status of `-1`
2023-04-12 09:02:39 +02:00
Tristan B. Velloza Kildaire 3830dd45bc Commands
- On any `ErrnoException` exit with exit code `-2`
2023-04-12 09:01:47 +02:00
Tristan B. Velloza Kildaire 4d457c2eb3 Disabled 'simple_variables.t' as it uses the now-currently unsupported 'discard' keyword 2023-04-12 08:59:19 +02:00
Tristan B. Velloza Kildaire 715efb1b14 Compiler
- On `compile` command failure exit with a status of `-1`
2023-04-12 08:55:42 +02:00
Tristan B. Velloza Kildaire 5ef028af19 Merge branch 'vardec_varass_dependency' into pointers 2023-04-12 08:47:57 +02:00
Tristan B. Velloza Kildaire f9e1a28296 Compiler
- Documented `CompilerError` and all of its enums
2023-04-12 08:46:26 +02:00
Tristan B. Velloza Kildaire f43cfb2b9d Test cases
- Added pointer arithmetic in the form of `*(ptr+0)` to `simple_pointer.t` to start testing it out
2023-04-12 08:36:48 +02:00
Tristan B. Velloza Kildaire 8490f3d7fd Typechecker
- Moved `attemptPointerAriehmeticCoercion(Value, Value)` to class-level and made privately accessible
2023-04-12 08:36:20 +02:00
Tristan B. Velloza Kildaire 554b9af0da Typecheck
- Added `attemptPointerAriehmeticCoercion(Value, Value)`
2023-04-11 20:22:27 +02:00
Tristan B. Velloza Kildaire 3b41654e04 Removed temporary file 2023-04-11 19:17:53 +02:00
Tristan B. Velloza Kildaire 7654e1cbe8 Make branches not identical 2023-04-11 19:17:20 +02:00
Tristan B. Velloza Kildaire bf2ad84b28
Update README.md 2023-03-26 14:13:56 +02:00
Tristan B. Velloza Kildaire c78679c297
Update README.md 2023-03-26 14:13:16 +02:00
Tristan B. Velloza Kildaire 95084ec639
Disabled deployment for now
Permissions problems.
2023-03-26 14:11:43 +02:00
Tristan B. Velloza Kildaire dd31ae1263
Update d.yml 2023-03-26 14:01:59 +02:00
Tristan B. Velloza Kildaire 42fe576d33
Update d.yml 2023-03-26 13:57:42 +02:00
Tristan B. Velloza Kildaire 1e65b2caee
Update d.yml 2023-03-26 13:51:35 +02:00
Tristan B. Velloza Kildaire 8c588ab52f
Update d.yml 2023-03-26 13:45:30 +02:00
Tristan B. Velloza Kildaire 98b954009d
Update d.yml 2023-03-26 13:43:45 +02:00
Tristan B. Velloza Kildaire a734347a89
Update d.yml 2023-03-26 13:41:22 +02:00
Tristan B. Velloza Kildaire 009c4cf560
Update d.yml 2023-03-26 13:39:19 +02:00
Tristan B. Velloza Kildaire ea7699bc36
Update d.yml 2023-03-26 13:37:10 +02:00
Tristan B. Velloza Kildaire 3a8d856fbc
Update d.yml 2023-03-26 13:32:22 +02:00