Skip to content

Commit

Permalink
[0-2024-0]
Browse files Browse the repository at this point in the history
  • Loading branch information
sa-tasche committed Aug 27, 2024
1 parent 5a43cf8 commit b3e2433
Show file tree
Hide file tree
Showing 73 changed files with 1,759 additions and 438 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

/.vscode
book
1 change: 0 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Attribution-ShareAlike 4.0 International

=======================================================================

Creative Commons Corporation ("Creative Commons") is not a law firm and
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# Specification
# Specification

- Read the License
- [as Text](./LICENSE.txt)
- [as Markup](./docs/0-2024-0/LICENSE.md)
- [Read the Specification](./docs/0-2024-0/index.md)
18 changes: 18 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Summary

- [Welcome](./0-2024-0/ENTRY.md)
- [Introduction](./0-2024-0/introduction)
- [Convention](./0-2024-0/convention.md)
- **Build-ins**
- '[On-Hand](./0-2024-0/built-in_on-hand.md)'
- _Types_
- [Basic](./0-2024-0/built-in_type.md)
- [Data Structure](./0-2024-0/built-in_datastruct.md)
- [Flow Control](./0-2024-0/built-in_flow-constrol.md)
- [Operation](./0-2024-0/built-in_operation.md)
- _Syntax Sugar_
- [A Pinch](./0-2024-0/built-in_syntactic-sugar.md)
- [Another Pinch](./0-2024-0/built-in_more-sugar.md)
- [Tips and Tricks](./0-2024-0/tips-and-tricks.md)
- [Appendice](./0-2024-0/appendice.md)
- [A](./0-2024-0/appendix-a.md)
17 changes: 17 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[book]
authors = ["Sara Tasche"]
language = "en"
multilingual = true
src = "docs"
title = "minimaLang - Specification"


[output.html]
smart-punctuation = true
git-repository-url = "https://github.com/minimaLang/"
git-repository-icon = "fa-github"
# edit-url-template = ""

[output.html.print]
enable = true
page-break = true
4 changes: 4 additions & 0 deletions docs/0-2024-0/ENTRY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Welcome

- [Introduction](./0-2024-0/introduction)
- [Convention](./0-2024-0/convention.md)
3 changes: 3 additions & 0 deletions docs/0-2024-0/appendice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Appendice

- [A](appendix-a.md)
2 changes: 0 additions & 2 deletions docs/md/appendix-a.md → docs/0-2024-0/appendix-a.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# Appendix A

( ... )
89 changes: 89 additions & 0 deletions docs/0-2024-0/built-in_datastruct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Data Structure

- [Mark](#mark)
- [Pair](#pair)
- [Sequence](#sequence)
- [of Value](#of-value)
- [of Expression](#of-expression)

## Mark

| Symbol | Syntax | Name
| ---------- | -------------- | ----
| `"` .. `"` | _Sym> <> <Sym_ | Mark

## Pair

| Symbol | Count | Syntax | Name
| --------- | :---: | ----------------------------- | ----
| `(` ..`)` | 2 | _Sym> <1:Key> <2:Value> <Sym_ | Pair

A pair consists of _key_ and _value_. \
The _key_ must be of type _[Constant](built-in_type#constant)_.

```minimaL
( 'A 31 ; 'B 21 ) : C
C 'A N :
C 'B M :
```

- `N` answers `32`
- `M` answers `21`

## Sequence

| Token
| ----------
| `[` .. `]`

- [Value](#of-value)
- [Expression](#of-expression)

### of Value

| Type | Token
| ----- | --------
| Begin | `(`
| Infix | _Values_
| End | `)`

- _Valid_
1. `[ 1 2 3 ]`
2. `( [ 1 2 3 ] [ A B C ] )`
3. `( [ 1 A 5 ] )`
- _Invalid_
1. `( 1 2 3 )`
2. `( )`
3. `[ ]`

```minimaL
1 A :
2 B :
3 C :
[ A B C ] + O :
```

`O` _answers_ `6`

```minimaL
D 1 :
E 2 :
F 3 :
G 2 :
[ D E ] < + / >
```

### of Expression

| Token | Name
| ------------ | ---------------------
| `{` | Expression-List-Begin
| _Expression_ | Expression
| `}` | Expression-List-End

```minimaL
{
1 A :
2 B :
}
```
49 changes: 28 additions & 21 deletions docs/md/flow-control.md → docs/0-2024-0/built-in_flow-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

## Loop

A _Loop_ is a combination of a _Branch_ and a _Comparsion_.
A _Loop_ is a combination of a _Branch_ (Jump) and a _Comparsion_.

```minimaL
A 200 :
B 10 :
200 : A
10 : B
.. Loop1
A B - : C
C 0 ?0 : Loop1 ..
C 0 ?0 : Loop1 !
```

In other programming language is this equvialent to
Expand All @@ -30,31 +30,37 @@ In other programming language is this equvialent to

## Branch

| Name | Token |
| :-------- | :--------: |
| Condition | `?0`, `?1` |
| Branch | `:` |
| Name | Token |
| --------- | ----------- |
| Condition | `?0`, `?1` |
| Branch | _label_ `!` |

| Syntax |
| :---------: |
| ----------- |
| _Condition_ |
| _Value_ |
| _Branch_ |
| _Label_ |

The jump target is a [Label](#label).

- _Valid_
1. `20 21 - 0 = ?0 : Jump ..`
2. `5 5 - 0 = : A ?0 : Jump ..`
- _Example_
1. `20 21 - 0 ?0 : Jump !`
- _Invalid_
1. `20 21 - 0 = ?0 Jump ..`
2. `20 21 - 0 = :`
1. `20 21 - 0 ?0 Jump !`
2. `20 10 - ?0 : Jump !`
3. `20 21 - 0 : Jump !`
4. `20 21 - 0 ?0 : Jump`

1. Colon missing (`:`)
2. No comparative value
3. Condition missing
4. Branch-Symbol missing (`!`)

## Label

| Token |
| :---: |
| ----- |
| `..` |

See [Branch](#branch), [Loop](#loop)
Expand All @@ -73,12 +79,13 @@ A _Label_ can be used to ...

### Define

| Syntax |
| :---------------: |
| _Token_ LabelName |
| Token | Syntax | Name |
| ----- | ---------- | --------- |
| `..` | `..` label | Set-Label |
| `..` | label `..` | Get-Label |

### Jump

| Syntax |
| :---------------: |
| LabelName _Token_ |
| Token | Syntax | Name |
| ----- | ---------- | ------- |
| `!` | label `!` | Jump-To |
19 changes: 19 additions & 0 deletions docs/0-2024-0/built-in_more-sugar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# More Sugar

- [Familiarize with used syntax convention](syntax-convention.md)

## Value-List

| Token | Syntax | Name |
| :--------: | :------: | :--------: |
| `{` .. `}` | _.._ _?_ | Value-List |

```minimaL
{ 0 1 2 3 } 2 ** { A B C D } :
```

- Answers
1. [_A_] 0
2. [_B_] 2
3. [_C_] 4
4. [_D_] 9
5 changes: 5 additions & 0 deletions docs/0-2024-0/built-in_on-hand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# On-Hand

Please read _[Syntax Convention](convention.md)_

## Overview
Loading

0 comments on commit b3e2433

Please sign in to comment.