0.4.2-1 • Published 6 years ago

lua2php v0.4.2-1

Weekly downloads
4
License
AGPL-3.0-or-later
Repository
gitlab
Last release
6 years ago

lua2php

npm package npm downloads

A Lua to PHP transpiler.

Usage

CLI

$ yarn add lua2php
$ npx lua2php a.lua

Examples

Visit examples.

Implementation

  • Table => (object)["array"=>[......]]
  • #a => count(a->array)

Different from Lua5.1

  • Can only get the length of a continuous array.
  • No loadstring, metatable, user-defined iterator ...
  • table, unpack, tostring, print, error, string, pairs, ipairs cannot be used as normal identifiers.
  • error can only receive one string argument. Translated to throw new Exception()
  • print can only receive one string argument.
  • string.sub can only receive one string and two positive integers.
  • The value of ... and ..., ... or ... is boolean.
  • Multiple return or assignment or for a,b,c in pairs(...)(c is nil) or ... is not supported (except ...=unpack(...))
  • No TCO
  • The variables captured in closures in the loop are the variables in the last.
  • for k, v in pairs(...). There is no +1 when k is a number.

Projects using lua2php

0.4.2-1

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0-2

6 years ago

0.4.0-1

6 years ago

0.4.0

6 years ago

0.3.4-1

6 years ago

0.3.4

6 years ago

0.3.3-1

6 years ago

0.3.3

6 years ago

0.3.2-1

6 years ago

0.3.2

6 years ago

0.3.1-c

6 years ago

0.3.1-b

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.7

6 years ago

0.1.6-2

6 years ago

0.1.6-1

6 years ago

0.1.6

6 years ago

0.1.5-c

6 years ago

0.1.5-b

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3-b

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1-a

6 years ago

0.0.1

6 years ago