Last active
May 17, 2019 17:40
-
-
Save CaptainPRICE/17681965616597561d0b1ab914bc11f7 to your computer and use it in GitHub Desktop.
A test source code to be converted from GLua into Lua syntax. Regex users tryhard. If you ever come up with the Regex solution that would convert such code from GLua into Lua syntax (without breaking any of the code including comments), please do let me know.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert me into Lua syntax | |
// using Regex./* | |
if (!false != !!!(!false) | |
||not !'\"\\' | |
)/*&&"!||false!=true\ | |
*/then | |
local _=MsgN( | |
"!*/es\"cap[==[!i[[ng!=]'!=\'*/"&&"/*!es\"cap[==[!i[[ng!=]'!=\'\ | |
'\34Regex fails hard\34\\/*\ | |
!nope"||!( | |
"!es\"cap[==[!i[[ng!=]'!=\'*/"||"/*\ | |
Regex replace fails hard\\!not\ | |
\"!!yep")!= | |
!false and !1 or 0)/* | |
// " | |
*/end--&&" | |
print(!/* without*/not true) | |
/*breaking | |
/ * "code \"** / | |
and comments! | |
if (!false != !!!(!false) | |
||not !'\"\\' | |
)//&&"!||false!=true\ | |
'then | |
local _=print( | |
"!*es\"cap[==[!i[[ng!=]'!=\'*"&&"/*!es\"cap[==[!i[[ng!=]'!=\'\ | |
\34Regex fails hard\34\\/*\ | |
!"||!( | |
"!es\"cap[==[!i[[ng!=]'!=\'*"||"/*\ | |
Regex replace fails hard\\!not\ | |
\"!!yep")!= | |
!false and !1 or 0)/* | |
// " | |
* //end--&&" | |
print(!/* without*not true) | |
"*/ | |
Msg([===[ | |
// Convert me into Lua syntax | |
// using Regex./* | |
//(!]===[{/* | |
if (!false != !!!(!false) | |
||not !'\"\\' | |
)//&&*/||"\ | |
then | |
local _=print( | |
"!*/es\"cap[==[!i[[ng!=]'!=\'*/"&&"/*!es\"cap]==]!i[[ng!=]'!=\'\ | |
\34Regex fails hard\34\ | |
!nope"||!( | |
"!es\"cap[==[!i[[ng!=]'!=\'*/"||"/*\ | |
Regex replace fails hard\\!not\ | |
\"!!yep")!= | |
!false!=true and !1 or 0)/*"\ | |
// "[===] | |
*/end--&&" | |
print(!/* without*/not true) | |
/*breaking | |
/ * "code \"** / | |
and comments! | |
!(the end)!=[[true]]&&true||false]===]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment