Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson committed May 29, 2024
1 parent fe1875c commit a7f772e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/language/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In the provided code snippet, we can see how arrays work:
```mew
let foo = new string[] { "A", "B", "C" };
let bar = i32[4];
let mut bar = i32[4];
bar[0] = 0;
bar[1] = 1;
bar[2] = 2;
Expand All @@ -27,7 +27,7 @@ let foo = new string[] { "A", "B", "C" };
This line declares an array of type `string` and initializes it with three string elements "A", "B", and "C". In Mew, arrays can be initialized with values directly using the curly braces syntax.

```mew
let bar = new i32[4];
let mut bar = new i32[4];
```

This line declares an array of type `i32`, specifying the size of the array as 4. The array is created, but it is initially empty.
Expand Down
4 changes: 1 addition & 3 deletions docs/language/assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ to be an integer `i32`, but in cases where you
want to be explicit, you can specify the type.

```mew
let x : i16 = 1;
let x: i16 = 1;
```

### Mutability
Expand All @@ -27,7 +27,5 @@ use the `mut` keyword.
```mew
let mut x = 1;
x = 2; // Variable can now be updated
print(x) // => 2
```

4 changes: 2 additions & 2 deletions docs/language/casting.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ sidebar_position: 50
// it with the value 32. The type of `i` is specified as any
// which means it can hold values of any data type.
// In this case, it holds an integer value.
let i : any = 32;
let i: any = 32;
// This line attempts to cast the value stored in `i` to the
// data type `i32` which is a signed 32-bit integer.
let j = i as i32;
let j= i as i32;
```

In summary, casting in this code snippet involves converting a value from the generic `any` type to the specific `i32` type, ensuring that the variable `j` is of the desired data type. This casting operation is possible because the original value in `i` is compatible with the target data type `i32`.
4 changes: 2 additions & 2 deletions docs/language/control/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 20
### `loop`

```mew
let foo = 0;
let mut foo = 0;
loop {
if foo < 100 {
foo = foo + 1;
Expand All @@ -22,7 +22,7 @@ loop {
### `while`

```mew
let foo = 0;
let mut foo = 0;
while foo < 100 {
foo = foo + 1;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/language/primitives/any.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ sidebar_position: 30
# Any

```mew
let foo : any = 32;
let foo: any = 32;
```
4 changes: 2 additions & 2 deletions docs/language/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All fields must be initialized when creating a class.

```mew
pub type Person {
pub field name : string;
pub field name: string;
}
```

Expand Down Expand Up @@ -65,7 +65,7 @@ one or more static methods; by convention called `new`.

```mew
pub type Person {
pub field name : string;
pub field name: string;
pub static fn new(name: string) -> Person {
return Person(name: name)
Expand Down

0 comments on commit a7f772e

Please sign in to comment.