mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
verb mods
This commit is contained in:
parent
e7883442ff
commit
7d730b05e9
3 changed files with 17 additions and 3 deletions
|
|
@ -490,6 +490,8 @@ func (tr *TransformerPut) Transform(
|
|||
|
||||
tr.runtimeState.Update(inrec, &context)
|
||||
|
||||
// TODO: check for exit statement; if so, don't process any records ...
|
||||
|
||||
// Execute the main block on the current input record
|
||||
outrec, err := tr.cstRootNode.ExecuteMainBlock(tr.runtimeState)
|
||||
if err != nil {
|
||||
|
|
@ -508,6 +510,12 @@ func (tr *TransformerPut) Transform(
|
|||
}
|
||||
}
|
||||
|
||||
// Check for exit statement
|
||||
if tr.runtimeState.ExitInfo.HasExitCode {
|
||||
inrecAndContext.ExitInfo.HasExitCode = true
|
||||
inrecAndContext.ExitInfo.ExitCode = tr.runtimeState.ExitInfo.ExitCode
|
||||
}
|
||||
|
||||
} else {
|
||||
tr.runtimeState.Update(nil, &context)
|
||||
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ func NewExitInfo() *ExitInfo {
|
|||
}
|
||||
|
||||
type RecordAndContext struct {
|
||||
Record *mlrval.Mlrmap
|
||||
Context Context
|
||||
// TODO: rmeove probably ExitInfo ExitInfo
|
||||
Record *mlrval.Mlrmap
|
||||
Context Context
|
||||
ExitInfo ExitInfo
|
||||
OutputString string
|
||||
EndOfStream bool
|
||||
}
|
||||
|
|
|
|||
6
todo.txt
6
todo.txt
|
|
@ -25,6 +25,12 @@ RELEASES
|
|||
================================================================
|
||||
FEATURES
|
||||
|
||||
----------------------------------------------------------------
|
||||
EXIT STATEMENT
|
||||
|
||||
* handling in begin-blocks?
|
||||
* handling in the REPL?
|
||||
|
||||
----------------------------------------------------------------
|
||||
EXTENDED FIELD ACCESSORS
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue