Skip to content

Commit

Permalink
update documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jul 19, 2023
1 parent 8c21ad8 commit c3ddf2d
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 29 deletions.
8 changes: 8 additions & 0 deletions src/common-concepts/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ For example:
static my_int: int = 20
```

::: tip
C++ linked variables can't be static.
:::

## Global Variables

Global variables are in the main scope of the program and are static variables by nature. Therefore, variables in the global scope must be declared as static.
Expand All @@ -82,6 +86,10 @@ fn main() {
}
```

::: tip
C++ linked globals can be declare via `let` keyword.
:::

## Multiple Assignment / Declaration
You can multiple variable assignment or declaration. What? Sure, you can use two type in same statement. You know how to declare variable, okay it is same. The single difference, identifiers and expressions separate with comma.

Expand Down
2 changes: 1 addition & 1 deletion src/standard-library/std-debug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# std::debug

## Globals
### `mut let ENABLE: bool`
### `static mut ENABLE: bool`
If this is enabled, debug and all subpackages assume that the program has been compiled for debugging. In this case the debugging tools work. However, if it is not enabled, the debugging tools will not work because it assumes that the program was not compiled for debugging.
28 changes: 14 additions & 14 deletions src/standard-library/std-jule-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Extension (includes dot) of Jule source code files.

---

### `let mut OS: str`
### `let static OS: str`
Target operating system. \
Setted to current operating system by default.

---

### `let mut ARCH: str`
### `let static ARCH: str`
Target architecture. \
Setted to current architecture by default.

Expand All @@ -38,71 +38,71 @@ Identifier of initializer function.

---

### `let DIRECTIVES: [...]Directive`
### `static DIRECTIVES: [...]Directive`
List of all directives.

---

### `let CPP_HEADER_EXTS: []str`
### `static CPP_HEADER_EXTS: [...]str`
Valid extensions of C++ headers.

---

### `let CPP_EXTS: []str`
### `static CPP_EXTS: [...]str`
Valid extensions of C++ source files.

---

### `let OBJECTIVE_CPP_EXTS: []str`
### `static OBJECTIVE_CPP_EXTS: [...]str`
Valid extensions of Objective-C++ source files.

---

### `let ERRORS: [str:str]`
### `static ERRORS: [str:str]`
Error messages.

---

### `let DISTOS: []Os`
### `static DISTOS: [...]Os`
List of supported operating systems.

---

### `let DISTARCH: []Arch`
### `static DISTARCH: [...]Arch`
List of supported architectures.

---

### `let DIRECTIVE_PREFIX: str`
### `const DIRECTIVE_PREFIX: str`
Prefix of directive comments.

---

### `let PATH_STDLIB: str`
### `static PATH_STDLIB: str`
Path of standard library.
::: warning
Initialized by initializer function.
:::

---

### `let PATH_EXEC: str`
### `static PATH_EXEC: str`
Path of executable file's directory.
::: warning
Initialized by initializer function.
:::

---

### `let PATH_WD: str`
### `static PATH_WD: str`
Path of working directory.
::: warning
Initialized by initializer function.
:::

---

### `let PATH_API: str`
### `static PATH_API: str`
Path of main API header file.
::: warning
Initialized by initializer function.
Expand Down
14 changes: 7 additions & 7 deletions src/standard-library/std-jule-lex.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# std::jule:lex

## Globals
### `let PUNCTS: []rune`
### `static PUNCTS: [...]rune`
Punctuations.

---

### `let SPACES: []rune`
### `static SPACES: [...]rune`
Space characters.

---

### `let UNARY_OPS: []TokenKind`
### `static UNARY_OPS: [...]TokenKind`
Kind list of unary operators.

---

### `let BIN_OPS: []TokenKind`
### `static BIN_OPS: [...]TokenKind`
Kind list of binary operators.

---

### `let WEAK_OPS: []TokenKind`
### `static WEAK_OPS: [...]TokenKind`
Kind list of weak operators.\
These operators are weak, can used as part of expression.

---

### `let POSTFIX_OPS: []TokenKind`
### `static POSTFIX_OPS: [...]TokenKind`
List of postfix operators.

---

### `let ASSIGN_OPS: []TokenKind`
### `static ASSIGN_OPS: [...]TokenKind`
List of assign operators.

## Functions
Expand Down
12 changes: 10 additions & 2 deletions src/standard-library/std-jule-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@ Possible values are: 32, and 64.

---

### `let SYS_INT: str`
### `static SYS_INT: str`
Signed integer kind of runtime architecture.\
Is equavalent to `int`, but specific bit-sized integer kind.\
Accept as constant.

::: warning
Setted by initializer function.
:::

---

### `let SYS_UINT: str`
### `static SYS_UINT: str`
Unsigned integer kind of runtime architecture.\
Is equavalent to `uint` and `uintptr`, but specific bit-sized integer kind.\
Accept as constant.

::: warning
Setted by initializer function.
:::

---

### `MAX_F32`
Expand Down
4 changes: 2 additions & 2 deletions src/standard-library/std-os.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# std::os
## Globals
### `let ARGS: []str`
### `static ARGS: []str`
Holds the command-line arguments.\
Starts with the program name.
::: warning
Expand All @@ -11,7 +11,7 @@ You got nil slice if used as initialize expression to any global.

---

### `let ENV: []str`
### `static ENV: []str`
Holds the environment variables.
::: warning
Environment variables sets at runtime with init function. \
Expand Down
6 changes: 3 additions & 3 deletions src/standard-library/std-sys.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ Available on: `windows`

---

### `let STDIN: uintptr`
### `static STDIN: uintptr`

---

### `let STDOUT: uintptr`
### `static STDOUT: uintptr`

---

### `let STDERR: uintptr`
### `static STDERR: uintptr`

---

Expand Down

0 comments on commit c3ddf2d

Please sign in to comment.