MCPcopy Index your code
hub / github.com/Shopify/go-lua / GoIfTrue

Method GoIfTrue

code.go:787–801  ·  view source on GitHub ↗
(e exprDesc)

Source from the content-addressed store, hash-verified

785}
786
787func (f *function) GoIfTrue(e exprDesc) exprDesc {
788 pc := noJump
789 switch e = f.DischargeVariables(e); e.kind {
790 case kindJump:
791 f.invertJump(e.info)
792 pc = e.info
793 case kindConstant, kindNumber, kindTrue:
794 default:
795 pc = f.jumpOnCondition(e, 0)
796 }
797 e.f = f.Concatenate(e.f, pc)
798 f.PatchToHere(e.t)
799 e.t = noJump
800 return e
801}
802
803func (f *function) GoIfFalse(e exprDesc) exprDesc {
804 pc := noJump

Callers 3

InfixMethod · 0.95
testThenBlockMethod · 0.80
conditionMethod · 0.80

Calls 5

DischargeVariablesMethod · 0.95
invertJumpMethod · 0.95
jumpOnConditionMethod · 0.95
ConcatenateMethod · 0.95
PatchToHereMethod · 0.95

Tested by

no test coverage detected