You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like the ability to normalize the whitespace of all code in a GPS. That is:
Any "unnecessary" spaces, those which do not effect the syntax of the code should be removed.
Any instances of multiple, consecutive, identical, white-space characters should be reduced to single instances of the character (except for tabs).
Newlines should only occur:
After semi-colons
After opening brackets {
Before and after closing brackets }
After colons : as in switch cases and labels.
After ) in for, if, and while blocks with no brackets
I am open to other logical instances.
All other newlines should be stripped out.
For example,
<-------------------------------------------------------------------->
for( int i=0; i<10; i++) would reduce to for(int i=0;i<10;i++). Note the only remaining space comes after the "int" as it is syntactically necessary.
<-------------------------------------------------------------------->
int i=0 reduces to int i=0 (got rid of double space)
<-------------------------------------------------------------------->
for(int i=0;i<10;i++)
foo()
remains unchanged
<--------------------------------------------------------------------> code
code
would be reduced to: code code
as newlines count.
<-------------------------------------------------------------------->
The goal here is to propose and validate one step in an obfuscation process. That is, a way to prevent stylometric attacks without obscuring the meaning of the code.
The text was updated successfully, but these errors were encountered:
I would like the ability to normalize the whitespace of all code in a GPS. That is:
Any "unnecessary" spaces, those which do not effect the syntax of the code should be removed.
Any instances of multiple, consecutive, identical, white-space characters should be reduced to single instances of the character (except for tabs).
Newlines should only occur:
After semi-colons
After opening brackets {
Before and after closing brackets }
After colons : as in switch cases and labels.
After ) in for, if, and while blocks with no brackets
I am open to other logical instances.
All other newlines should be stripped out.
For example,
<-------------------------------------------------------------------->
for( int i=0; i<10; i++) would reduce to for(int i=0;i<10;i++). Note the only remaining space comes after the "int" as it is syntactically necessary.
<-------------------------------------------------------------------->
int i=0 reduces to int i=0 (got rid of double space)
<-------------------------------------------------------------------->
for(int i=0;i<10;i++)
foo()
remains unchanged
<-------------------------------------------------------------------->
code
code
would be reduced to:
code
code
as newlines count.
<-------------------------------------------------------------------->
The goal here is to propose and validate one step in an obfuscation process. That is, a way to prevent stylometric attacks without obscuring the meaning of the code.
The text was updated successfully, but these errors were encountered: