diff options
author | c+1 | 2023-05-22 23:02:34 -0400 |
---|---|---|
committer | c+1 | 2023-05-22 23:02:34 -0400 |
commit | 20f57669d9a7574cb65d1a716f6b1071a8d72810 (patch) | |
tree | 1991c2499b9b1e0fd445e9a65024daadc7b74ca8 | |
parent | 8d50b4bf8792be8b9a7211da8f4110ba045b5c49 (diff) |
man.md
-rw-r--r-- | man.md | 66 |
1 files changed, 42 insertions, 24 deletions
@@ -1,38 +1,56 @@ -The HALK Programming Language -==================================================================================================== +# The HALK Programming Language *version 0.0.1* + *2023-05-22* -Syntax -==================================================================================================== +# Syntax + +## Definitions + +HALK has no special definition keyword. When a keyword that has not been defined is called, the +interpreter will assume the user is defining a new variable. Definitions have 3 major components: + +1. The **Definition Tags** +2. The **Definition Args** +3. The **Definition Value** + +### Definition Tags + +Tags help describe the variable before it is given a value. This ensures it will be handled properly +in the future. A variable definition can have any number of tags, but the most important one by far +is the type. + +```halk +int:n = 5; +``` + +The type is always the first tag, and is terminated by a colon `:` character. Following the type, +the second most important tag is the name, in this case `n`. The name tag is always the last. In +between these, there can be any number of tags. + +```halk +int:mut:var = 4; +int:imut:var2 = 4; +``` -Definitions ----------------------------------------------------------------------------------------------------- +In this case, `var` has the `mut` tag while `var2` has the `imut` tag. These indicate the +mutabillity of a variable. When not specified, the interpreter will assume `imut`. -Calls ----------------------------------------------------------------------------------------------------- +## Calls -Data Structures -==================================================================================================== +# Data Structures -Namespaces ----------------------------------------------------------------------------------------------------- +## Namespaces -Structs ----------------------------------------------------------------------------------------------------- +## Structs -Logic & Program Flow -==================================================================================================== +# Logic & Program Flow -If / Else ----------------------------------------------------------------------------------------------------- +## If / Else -For / While ----------------------------------------------------------------------------------------------------- +## For / While -Cond ----------------------------------------------------------------------------------------------------- +## Cond -Style -==================================================================================================== +# Style |