-
Notifications
You must be signed in to change notification settings - Fork 0
/
arguments.go
36 lines (32 loc) · 1002 Bytes
/
arguments.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package arguments
import "github.com/robotii/lito/compiler/token"
// Enums for different kinds of arguments
const (
NormalArg = iota
OptionedArg
SplatArg
RequiredKeywordArg
OptionalKeywordArg
)
// Types is a table maps argument types enum to the their real name
var Types = map[int]string{
NormalArg: "Normal argument",
OptionedArg: "Optioned argument",
RequiredKeywordArg: "Keyword argument",
OptionalKeywordArg: "Optioned keyword argument",
SplatArg: "Splat argument",
}
// Tokens marks token types that can be used as method call arguments.
// Any token that is not in the list cannot be used without parentheses
var Tokens = map[token.Type]bool{
token.Int: true,
token.String: true,
token.True: true,
token.False: true,
token.Nil: true,
token.InstanceVariable: true,
token.Constant: true,
token.LBrace: true,
token.Self: true,
token.Amp: true,
}