Implemented extern functions
This commit is contained in:
parent
38b573085e
commit
4803b81845
24 changed files with 304 additions and 169 deletions
|
@ -66,6 +66,7 @@ const (
|
|||
___KEYWORDS___ // <keywords>
|
||||
Assert // assert
|
||||
Else // else
|
||||
Extern // extern
|
||||
If // if
|
||||
Import // import
|
||||
Loop // loop
|
||||
|
|
|
@ -25,13 +25,14 @@ func TestFunction(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKeyword(t *testing.T) {
|
||||
tokens := token.Tokenize([]byte("assert if import else loop return struct switch"))
|
||||
tokens := token.Tokenize([]byte("assert if import else extern loop return struct switch"))
|
||||
|
||||
expected := []token.Kind{
|
||||
token.Assert,
|
||||
token.If,
|
||||
token.Import,
|
||||
token.Else,
|
||||
token.Extern,
|
||||
token.Loop,
|
||||
token.Return,
|
||||
token.Struct,
|
||||
|
|
|
@ -19,6 +19,8 @@ func identifier(tokens List, buffer []byte, i Position) (List, Position) {
|
|||
kind = If
|
||||
case "else":
|
||||
kind = Else
|
||||
case "extern":
|
||||
kind = Extern
|
||||
case "import":
|
||||
kind = Import
|
||||
case "loop":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue