Documentation
¶
Overview ¶
Package flatstack provides the runner embedding API with an opt-in flat bytecode backend. Unsupported programs are rejected before execution and run by the full interpreter, preserving runner behavior while the bytecode subset grows.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Supports ¶
Supports reports whether p will execute through flat bytecode rather than the compatibility interpreter. Call this in benchmarks to prevent measuring an accidental fallback.
Example ¶
package main
import (
"fmt"
"github.com/titpetric/phpscript/flatstack"
"github.com/titpetric/phpscript/parser"
)
func main() {
program, _ := parser.Parse(`<?php $a = "flat"; echo $a . "stack"; ?>`)
fmt.Println(flatstack.Supports(program) == nil)
}
Output: true
Types ¶
type ExprCache ¶
func NewExprCache ¶
func NewExprCache() *ExprCache
type HostPanicError ¶
type HostPanicError = runner.HostPanicError
type IncludeCache ¶
type IncludeCache = runner.IncludeCache
func NewIncludeCache ¶
func NewIncludeCache() *IncludeCache
type IncludeFunc ¶
type IncludeFunc = runner.IncludeFunc
type Transpiler ¶
type Transpiler = runner.Transpiler
func NewTranspiler ¶
func NewTranspiler() *Transpiler
Click to show internal directories.
Click to hide internal directories.