Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua to Windows Batch Translator

Donate via Stripe

Batch scripting is a train wreck. Logical operators are missing. Calling internal functions is broken. Calling external scripts is broken. Local variable scope is broken. So I'm making a fix for it.

Features:

  • global variables are transpiled into environment variables
  • local variables are transpiled into ... setlocal variables, which operate like Lua global variables, but are not environment variables.
  • global scope functions work
  • if-conditions work. 'and's, 'or's, 'not's, elseifs and else
  • arithmetic and concatenation operations work with assignment
  • select('#', ...) and select(n, ...) works when used for command-line arguments

depends upon:

Still TODO:

  • support for inline and lambda functions
  • keep track of what vars are in scope when a function is moved
  • local functions won't respect the local scope
  • scope of local variables isn't respected
  • breaking apart boolean expressions of statements into preceding temporary statements, and using them in either conditions or assignment
  • boolean operations are based on short-circuiting, so assigning to a boolean operation still needs to be implemented
  • in fact, merging the assignment and if-conditions, it might be best to use temp registers for bool expressions (and all expressions, for that matter)
  • heterogeneous tables -- non-numbers as keys
  • assigning functions to variables

About

utility for converting from Lua scripts to Windows Batch files

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages