Added Permission type
This commit is contained in:
parent
488220f3a7
commit
2e965d6f68
@ -2,6 +2,7 @@ package lexer
|
|||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
import "github.com/sashakoshka/arf/file"
|
import "github.com/sashakoshka/arf/file"
|
||||||
|
import "github.com/sashakoshka/arf/types"
|
||||||
|
|
||||||
func TestTokenizeAll (test *testing.T) {
|
func TestTokenizeAll (test *testing.T) {
|
||||||
file, err := file.Open("tests/lexer/all")
|
file, err := file.Open("tests/lexer/all")
|
||||||
@ -18,7 +19,10 @@ func TestTokenizeAll (test *testing.T) {
|
|||||||
|
|
||||||
correct := []Token {
|
correct := []Token {
|
||||||
Token { kind: TokenKindSeparator },
|
Token { kind: TokenKindSeparator },
|
||||||
Token { kind: TokenKindPermission /* TODO: value */ },
|
Token { kind: TokenKindPermission, value: types.Permission {
|
||||||
|
Internal: types.ModeRead,
|
||||||
|
External: types.ModeWrite,
|
||||||
|
}},
|
||||||
Token { kind: TokenKindReturnDirection },
|
Token { kind: TokenKindReturnDirection },
|
||||||
Token { kind: TokenKindInt, value: -349820394 },
|
Token { kind: TokenKindInt, value: -349820394 },
|
||||||
Token { kind: TokenKindUInt, value: 932748397 },
|
Token { kind: TokenKindUInt, value: 932748397 },
|
||||||
|
14
types/permission.go
Normal file
14
types/permission.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
type Mode int
|
||||||
|
|
||||||
|
const (
|
||||||
|
ModeRead = iota
|
||||||
|
ModeWrite
|
||||||
|
ModeNone
|
||||||
|
)
|
||||||
|
|
||||||
|
type Permission struct {
|
||||||
|
Internal Mode
|
||||||
|
External Mode
|
||||||
|
}
|
Reference in New Issue
Block a user