diff --git a/go/src/miller/dsl/cst/stack.go b/go/src/miller/dsl/cst/stack.go index a6b4fd705..b209860a9 100644 --- a/go/src/miller/dsl/cst/stack.go +++ b/go/src/miller/dsl/cst/stack.go @@ -13,11 +13,11 @@ import ( // ---------------------------------------------------------------- type Stack struct { - stackFrames *list.List // list of *StackFrame + stackFrames *list.List // list of *StackFrame } func NewStack() *Stack { - return &Stack { + return &Stack{ stackFrames: list.New(), } } @@ -54,7 +54,7 @@ func (this *Stack) Dump() { for entry := this.stackFrames.Front(); entry != nil; entry = entry.Next() { stackFrame := entry.Value.(*StackFrame) fmt.Printf(" VARIABLES (count %d):\n", len(stackFrame.vars)) - for k, v := range(stackFrame.vars) { + for k, v := range stackFrame.vars { fmt.Printf(" %-16s %s\n", k, v.String()) } } diff --git a/go/todo.txt b/go/todo.txt index 1e65c36a8..07ccb60bf 100644 --- a/go/todo.txt +++ b/go/todo.txt @@ -1,14 +1,13 @@ ---------------------------------------------------------------- TOP OF LIST: +* for-loop over arrays -- '@records[FILENAME][NR]' -- ? + o for-k needs to bind k to 1..n; likewise for-kv +* code-merge for-k, for-kv, for-knv + ! JSON null needs to be passed through as-is ... somehow ... new mlrval type?? o note json types: string, number, boolean, null, object, array. -* while and do-while statements -- not urgent - -* for-knv - o defer triple-for until later - ! quoted NIDX - how with whitespace regex -- ? ! quoted DKVP @@ -22,9 +21,6 @@ TOP OF LIST: * ASV? golang csv package parameterizes comma but not crlf :( -! filter / bare-boolean - o needs thorough UT on things like 'mlr put '1+2=3+4' - * mlr -f / -F o others in mlrcli_parse.go o copy over all operator help-strings from ../c @@ -68,10 +64,11 @@ CATEGORIES: - AST tree-walk / CST build: must be at top level - tree-walk begin/end to check for invalids ($-anything etc) - bare-boolean last statement in main block, & not in begin/end - o support the filter verb + o filter / bare-boolean needs thorough UT on things like 'mlr put '1+2=3+4' o UDFs o localvars - o if/for/etc + o for-knv + o triple-for ---------------------------------------------------------------- MAYBE: