verb mods

This commit is contained in:
John Kerl 2022-03-15 23:26:55 -04:00
parent e7883442ff
commit 7d730b05e9
3 changed files with 17 additions and 3 deletions

View file

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

View file

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

View file

@ -25,6 +25,12 @@ RELEASES
================================================================
FEATURES
----------------------------------------------------------------
EXIT STATEMENT
* handling in begin-blocks?
* handling in the REPL?
----------------------------------------------------------------
EXTENDED FIELD ACCESSORS