gluabit32

package module
v0.0.0-...-cb1e799 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2019 License: MIT Imports: 1 Imported by: 4

README

bit32 for GopherLua

A native Go implementation of bit32 for the GopherLua VM.

Using

Loading Module
import (
	"github.com/nubix-io/gluabit32"
)

// Bring up a GopherLua VM
L := lua.NewState()
defer L.Close()

// Preload bit32 module
gluabit32.Preload(L)
Invoking functions
script := `
  local bit32 = require 'bit32'
  return bit32.rshift(5, 1), bit32.rshift(0xffffffff, 0)`
L.DoString(script)
assert.equal(2, L.ToString(-2))
assert.equal(4294967295, L.ToString(-1))

Testing

$ go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(l *lua.LState) int

func Preload

func Preload(L *lua.LState)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL