This commit is contained in:
John Kerl 2020-09-23 19:54:27 -04:00
parent 0b0815d4b6
commit 48be076ae4
2 changed files with 10 additions and 13 deletions

View file

@ -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())
}
}

View file

@ -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: