Skip to content

Commit

Permalink
Updated the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Baudin999 committed Dec 18, 2019
1 parent a04566b commit 75d70ab
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/language.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@ It's always good to get the terminology right. ZDragon is the tool, this tool ha
build/watch and serve your content. ZDragon also parses your `car-lang` code and transpiles it to
HTML, XSDs and JSON schemas.

## Basic Types

`car-lang` supports the following base types:

- `String`
- `Number`
- `Decimal`
- `Boolean`
- `Date`
- `Time`
- `DateTime`

These types are the building blocks for all of your custom types.

Example:

```
type Person =
FirstName: String;
LastName: String;
```

Example 02:

```
alias Foo = Number;
```

## Types

Types are the bread and butter of ZDragon and explain how certain data structures should look. Type
Expand Down Expand Up @@ -212,6 +240,23 @@ Algebraic Data Types or ADTs for short have a lot of merrit but might seem hard
notice that they are the last types you will reach for when designing a logical data model but once
you get into service models you will use them for almost every result.

## Annotations

Annotations are "in-type" descriptions. Annotations will be taken along with every transformation.
You can annotate a type by using the `@` sign. You can use multiple annotations and those will be
aggregated into a single description. For example:

```
@ The person is
@ is someone...
type Person =
@ The first name
FirstName: String;
@ The last Name
LastName: String;
```

## Conclusion

This concludes our introduction of the `car-lang` language. Later in our chapters we'll see how we
Expand Down

0 comments on commit 75d70ab

Please sign in to comment.