From 8af31b94614a8ecd1e68fa18771ab9337b6b3fa7 Mon Sep 17 00:00:00 2001 From: Anton Kesy Date: Mon, 18 Mar 2024 11:07:25 +0100 Subject: [PATCH] add links to examples --- README.md | 34 +++++++++++++++++++++++----------- examples/primitives.mmm | 3 +++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b4b788b..72fabd8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The missing link between C and Python C style syntax with Python like runtime interpretation and built in functions. -### Main +### [Main](./examples/main_hello_world.mmm) Main function `void main() {}` is the entry point. @@ -26,7 +26,7 @@ Alternately, statements are executed from top to bottom in case no main is found print("Hello, World!"); ``` -### Primitives +### [Primitives](./examples/primitives.mmm) - void - bool @@ -34,13 +34,13 @@ print("Hello, World!"); - float - str -### Conversion +### [Conversion](./examples/primitives.mmm) - `str(1)` -> `"1"` - `int("1")` -> `1` - `float("1.3")` -> `1.3` -#### Operations +#### [Operations](./examples/primitives.mmm) There is no operator precedence @@ -60,7 +60,7 @@ There is no operator precedence | && | x | ✓ | ✓ | x | x | | \|\| | x | ✓ | ✓ | x | x | -### Flow Control +### [Flow Control](./examples/control.mmm) If: @@ -82,7 +82,7 @@ while j < 10 { } ``` -### Functions +### [Functions](./examples/functions.mmm) ``` int f() { @@ -94,7 +94,7 @@ void main() { } ``` -### Structs +### [Structs](./examples/structs.mmm) ``` struct T { @@ -106,11 +106,11 @@ T t; t.x = 2; ``` -### Built In +### [Built In](./examples/hello_input.mmm) -- print -> prints -- println -> prints line -- input -> reads stdin +- print -> prints string without buffering +- println -> print + appends newline at the end +- input -> reads stdin and outputs str ## Limitations & Issues @@ -120,6 +120,18 @@ t.x = 2; - bad error messages from parser and interpreter - types are optional and currently not always strictly enforced +## Missing/Planned Features + +- Arrays +- Classes (or something similar) +- String manipulation +- Multiple files support +- Enums +- Pattern matching +- switch +- for +- define grammar + ## Installation ### Native diff --git a/examples/primitives.mmm b/examples/primitives.mmm index 2af4cc8..b23a584 100644 --- a/examples/primitives.mmm +++ b/examples/primitives.mmm @@ -14,3 +14,6 @@ if 1 > int("0") { if 1 < int(3.2) { println("smaller") } + +i = i + 5; +println(str(i));