Skip to content

Commit

Permalink
fixing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gravataLonga committed Jul 20, 2022
1 parent e1aaa11 commit 9a78023
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,21 @@ var lib = import "mylib.ninja"; // return function() {};

Logic's Operators
```
10 < 10;
10 > 10;
10 == 10;
10 != 10;
10 <= 10;
10 >= 10;
10 && 10;
10 || 10;
!10;
10 < 10; // FALSE
10 > 10; // FALSE
10 == 10; // TRUE
10 != 10; // FALSE
10 <= 10; // TRUE
10 >= 10; // TRUE
10 && 10; // TRUE
10 || 10; // TRUE
!10; // FALSE
!!10; // TRUE
```

> **Note**: a value is considered truthy when a value is not nil or not false.
`<expression>? <operator> <expression>`
Arithmetics Operators

Expand Down Expand Up @@ -377,14 +380,11 @@ if (true) {
}
```

> Note: a value is Truth if isn't null or false, 0 will evaulated like true.

## Loop

`for (<initial>?;<condition>?;<iteration>?) { <statements> }`

> **None** statements are optionals
> **None** initial, condition and iteration is optional, you can omit
```
var i = 0;
Expand Down Expand Up @@ -430,8 +430,6 @@ Here a full of list of support object call for string:

## Integer

Here a full of list of support objec call for integer:

```
1.type(); // "INTEGER"
1.string(); // "1"
Expand All @@ -441,8 +439,6 @@ var a = -1; a.abs(); // 1.0

## Float

Here a full of list of support objec call for integer:

```
1.0.type(); // "FLOAT"
1.0.string(); // "1.0"
Expand Down Expand Up @@ -497,7 +493,7 @@ return if else for import break case

> After the parser produces the syntax tree, but before the interpreter starts executing it, we’ll do a single walk over
> the tree to resolve all of the variables it contains. Additional passes between parsing and execution are common.
> If Lox had static types, we could slide a type checker in there. Optimizations are often implemented in separate
> If <name-of-programming-language> had static types, we could slide a type checker in there. Optimizations are often implemented in separate
> passes like this too. Basically, any work that doesn't rely on state that’s only available at runtime can be done
> in this way.
Expand Down Expand Up @@ -545,15 +541,3 @@ go test -race
- Parsing Techniques. A Practical Guide.. Ellis Horwood Limited.
- Modern Compiler Design, Second Edition. Springer
- The Elements Of Computing Systems. MIT Press.

# Others

```
Program code -> Lexical Analysis (Lexer) -> Syntactic Analysis (Parser) -> Semantic Analysis -> Generated/Optimization -> Machine Code
```

1. Program code (Ninja Code)
2. Lexer -> Produce Tokens
3. Parser -> Produces AST Tree
4. Semantic Analysis -> Syntax of AST
5. Evaluator -> Produce Object

0 comments on commit 9a78023

Please sign in to comment.