Posted 24 November 2012 - 11:20 AM
Hello all.
This small program automatically replaces any occurrences of the augmented-assignment operators (+=, -=, etc), with the longer forms (x = x + y, x = x - y).
It takes only one parameter (the file to modify), and writes the output to a file with the same name, but with the ".withOperators" extension.
Example Input/Output:
Input:
Output:
Download:
Operator Replacer on Pastebin
In-game Download:
This small program automatically replaces any occurrences of the augmented-assignment operators (+=, -=, etc), with the longer forms (x = x + y, x = x - y).
It takes only one parameter (the file to modify), and writes the output to a file with the same name, but with the ".withOperators" extension.
Example Input/Output:
Input:
local variable = 100
variable += 5
variable -= 5
variable *= 5
variable /= 5
variable %= 5
variable &= 5
variable ^= 5
variable |= 5
variable >>= 5
variable <<= 5
variable += 125 * 100 - 2623 - 930
print(variable)
Output:
local variable = 100
variable = variable + 5
variable = variable - 5
variable = variable * 5
variable = variable / 5
variable = variable % 5
variable = bit.band(variable, 5)
variable = bit.bxor(variable, 5)
variable = bit.bor(variable, 5)
variable = bit.brshift(variable, 5)
variable = bit.blshift(variable, 5)
variable = variable + 125*100-2623-930
print(variable)
Download:
Operator Replacer on Pastebin
In-game Download:
pastebin get FuTrBPMq operatorReplacer