added grammar to docs

This commit is contained in:
Lauchmelder 2021-11-26 22:41:52 +01:00
parent b010bf60ee
commit ecdac9bfa8

View file

@ -13,4 +13,12 @@ circle(A, len(AB))
## Primitives
* `Point point(x, y)` is a 2D point. It returns an element of type `Point`
* `Line line(Point from, Point to)` is a straight line. It returns an element of type `Line`.
* `Circle circle(Point center, radius)` draws a circle at `center` and `radius`
* `Circle circle(Point center, radius)` draws a circle at `center` and `radius`
## Grammar
```
instruction ::= identifier({parameter, })
parameter ::= instruction | identifier | number
identifier ::= (A-Za-z)
number ::= (0-9)[.(0-9)]
```