Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Removed "in" keyword from tokenizer. Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kugelschieber committed Nov 3, 2015
1 parent 0ca6566 commit 2bc11fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Main reasons for ASL:
* easy to learn and understand
* full replacement of SQF
* compatible with Arma wiki and commands
* comfortable

## Usage

Expand Down Expand Up @@ -76,6 +77,8 @@ Controll structure syntax is C-like. Notice they are all using the same brackets
```
if 1 < 2 {
// ...
} else { // no else if yet
// ...
}
while 1 < 2 {
Expand Down Expand Up @@ -122,7 +125,7 @@ var _x = add(1, 2);
// result in _x is 3
```

Functions support optional parameters by predefining them:
Functions support predefined parameters:

```
func add(_a = 0, _b = 0) {
Expand All @@ -146,7 +149,7 @@ addItem(someUnit)("NVGoogles");
someUnit addItem "NVGoogles";
```

Where the first brackets contain the parameters used in front of SQF command and the second ones behind SQF command. If more than one parameter is passed, it will be converted to an array.
Where the first brackets contain the parameters used in front of SQF command and the second ones behind SQF command. If more than one parameter is passed, it will be converted to an array. This syntax can be used for **all** build in functions (also spawn and so on).

```
foo(x, y, z)(1, 2, 3);
Expand Down Expand Up @@ -200,8 +203,7 @@ x = {y = 5;};
## Preprocessor

The preprocessor works like the original one, with some limitations.
Please visit the link at the bottom, to read about the preprocessor and how to use it. Generally, preprocessor lines must start with the hash key (#) and must stay in their own line. They are always printed as seperate lines.
These features are not supported:
Please visit the link at the bottom, to read about the preprocessor and how to use it. Generally, preprocessor lines must start with the hash key (#) and must stay in their own line. They are always printed as seperate lines. These features are not supported:

* replacing parts of words
* multi line preprocessor commands
Expand Down Expand Up @@ -243,12 +245,12 @@ Keywords should not be used as identifiers. Here is a full list of all keywords
| exitwith |
| waituntil |
| code |
| in |

## What's missing?

The following features are not implemented yet, but will be in 1.1.0 or a future version:

* else if
* arrays within expressions (like someArray-[someEntity])

There is a simple workaround for arrays within expressions:
Expand Down
3 changes: 1 addition & 2 deletions src/tokenizer/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ var keywords = []string{
"catch",
"exitwith",
"waituntil",
"code",
"in"}
"code"}

var whitespace = []byte{' ', '\n', '\t', '\r'}
var identifier = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
Expand Down

0 comments on commit 2bc11fb

Please sign in to comment.