Skip to content

Commit

Permalink
chore: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
llafuente committed Nov 25, 2024
1 parent d71822a commit a6d97d3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
4 changes: 2 additions & 2 deletions spec/language/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ function main() {
https://clang.llvm.org/doxygen/classclang_1_1SwitchStmt.html
-->

### `switch` (`case`, `break` and `fallthrough`)
### `switch` (`case`, `default` `break` and `fallthrough`)

*Syntax*

```syntax
switchCaseStmt
// REVIEW syntax require block here ? also required colon ?
: 'case' expressionList ':' functionBodyStmtList
: 'case' expressionList ':' functionBodyStmtList
| 'default' ':' functionBodyStmtList
;

Expand Down
8 changes: 6 additions & 2 deletions spec/language/types/numeric-arithmetic.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ representation.
Example:

```
```language
function main() {
print(i8.MAX) // 128
print(i8.MIN) // -127
print(i8.BYTES) // 1
print(i8.BITS) // 8
}
```


Expand Down Expand Up @@ -137,6 +139,8 @@ Like array length, capacity.
https://en.cppreference.com/w/cpp/types/size_t
-->

### `ptrsize`

### `ptrdiff`

Type that can store the difference of two pointers.
Expand Down Expand Up @@ -210,4 +214,4 @@ var my_static_array<void> = msar
print(msar.length) // KO, because it cannot determine offset
```
-->
-->
23 changes: 0 additions & 23 deletions tests/syntax-smoke-screen.language
Original file line number Diff line number Diff line change
Expand Up @@ -290,26 +290,3 @@ type masky = mask {
}


function integers() {
const decimal_int = 98222
const hex_int = 0xff
const another_hex_int = 0xFF
const octal_int = 0o755
const binary_int = 0b11110000
const one_billion = 1_000_000_000
const binary_mask = 0b1_1111_1111
const permissions = 0o7_5_5
const big_address = 0xFF80_0000_0000_0000
}

function floating() {
const floating_point = 123.0E+77
const another_float = 123.0
const yet_another = 123.0e+77
//const hex_floating_point = 0x103.70p-5
//const another_hex_float = 0x103.70
//const yet_another_hex_float = 0x103.70P-5
const lightspeed = 299_792_458.000_000
const nanosecond = 0.000_000_001
//const more_hex = 0x1234_5678.9ABC_CDEFp-10
}
7 changes: 7 additions & 0 deletions tests/types.language
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ type use_mini_array = struct {
mini_array3<abcstruct> arr4
}

type v2 = struct {
float x
float y
static v2 ZERO = v2 {0, 0}
static v2 ZERO2 = {0, 0}
}

// self usage

type namewillchange<$t> = struct {
Expand Down

0 comments on commit a6d97d3

Please sign in to comment.