Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F8896169
jsxmin_main.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
916 B
Subscribers
None
jsxmin_main.cpp
View Options
#include
"libfbjs/node.hpp"
#include
"jsxmin_renaming.h"
#include
"jsxmin_reduction.h"
#include
<iostream>
using
namespace
std
;
using
namespace
fbjs
;
static
void
jsxminify
(
NodeProgram
*
root
,
string
&
replacements
)
{
// Code reduction should happen at the first.
CodeReduction
code_reduction
;
code_reduction
.
replacements
=
replacements
;
code_reduction
.
process
(
root
);
// Starts in the global scope.
VariableRenaming
variable_renaming
;
variable_renaming
.
process
(
root
);
/*
PropertyRenaming property_renaming;
property_renaming.process(root);
*/
}
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
string
replacements
(
argc
>
1
?
argv
[
1
]
:
""
);
// Create a node.
NodeProgram
root
(
stdin
);
jsxminify
(
&
root
,
replacements
);
cout
<<
root
.
render
(
RENDER_NONE
).
c_str
();
}
catch
(
ParseException
ex
)
{
fprintf
(
stderr
,
"parsing error: %s
\n
"
,
ex
.
what
());
return
1
;
}
return
0
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Fri, Jun 11, 10:44 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
3391392
Default Alt Text
jsxmin_main.cpp (916 B)
Attached To
rJX Javelin
Event Timeline
Log In to Comment