From 3e679c51c03ac13a5b4b601873689925eda3cc16 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 2 Apr 2018 14:21:45 +0200 Subject: pkg/compiler: support non-zero terminated filenames Now file names become: string[filename] with a possibility of using other string features: stringnoz[filename] string[filename, CONST_SIZE] and filename is left as type alias as it is commonly used: type filename string[filename] --- pkg/compiler/compiler.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/compiler/compiler.go') diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index f1e39b269..809de5bd5 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -64,8 +64,11 @@ func Compile(desc *ast.Description, consts map[string]uint64, target *targets.Ta structNodes: make(map[*prog.StructDesc]*ast.Struct), structVarlen: make(map[string]bool), } - for name, typedef := range builtinTypedefs { - comp.typedefs[name] = typedef + for name, n := range builtinTypedefs { + comp.typedefs[name] = n + } + for name, n := range builtinStrFlags { + comp.strFlags[name] = n } comp.typecheck() // The subsequent, more complex, checks expect basic validity of the tree, -- cgit mrf-deployment