Add non pretty printing function to Templates.
This commit is contained in:
parent
dc62a69775
commit
51b36d1a1f
1 changed files with 13 additions and 7 deletions
|
|
@ -78,6 +78,8 @@ public:
|
||||||
|
|
||||||
Template& replace(const String *pattern, const String *repl);
|
Template& replace(const String *pattern, const String *repl);
|
||||||
|
|
||||||
|
Template& print(DOH *doh);
|
||||||
|
|
||||||
Template& pretty_print(DOH *doh);
|
Template& pretty_print(DOH *doh);
|
||||||
|
|
||||||
void operator=(const Template& t);
|
void operator=(const Template& t);
|
||||||
|
|
@ -1092,7 +1094,6 @@ int JSEmitter::emitConstant(Node *n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int JSEmitter::emitFunction(Node *n, bool is_member, bool is_static) {
|
int JSEmitter::emitFunction(Node *n, bool is_member, bool is_static) {
|
||||||
|
|
||||||
Wrapper *wrapper = NewWrapper();
|
Wrapper *wrapper = NewWrapper();
|
||||||
Template t_function(getTemplate("js_function"));
|
Template t_function(getTemplate("js_function"));
|
||||||
|
|
||||||
|
|
@ -2038,8 +2039,8 @@ int V8Emitter::exitVariable(Node* n)
|
||||||
.replace("$jsname", state.variable(NAME))
|
.replace("$jsname", state.variable(NAME))
|
||||||
.replace("$jsgetter", state.variable(GETTER))
|
.replace("$jsgetter", state.variable(GETTER))
|
||||||
.replace("$jssetter", state.variable(SETTER))
|
.replace("$jssetter", state.variable(SETTER))
|
||||||
.trim()
|
.trim().
|
||||||
.pretty_print(f_init_static_wrappers);
|
print(f_init_static_wrappers);
|
||||||
} else {
|
} else {
|
||||||
Template t_register = getTemplate("jsv8_register_member_variable");
|
Template t_register = getTemplate("jsv8_register_member_variable");
|
||||||
t_register.replace("$jsmangledname", state.clazz(NAME_MANGLED))
|
t_register.replace("$jsmangledname", state.clazz(NAME_MANGLED))
|
||||||
|
|
@ -2047,7 +2048,7 @@ int V8Emitter::exitVariable(Node* n)
|
||||||
.replace("$jsgetter", state.variable(GETTER))
|
.replace("$jsgetter", state.variable(GETTER))
|
||||||
.replace("$jssetter", state.variable(SETTER))
|
.replace("$jssetter", state.variable(SETTER))
|
||||||
.trim()
|
.trim()
|
||||||
.pretty_print(f_init_wrappers);
|
.print(f_init_wrappers);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Note: a global variable is treated like a static variable
|
// Note: a global variable is treated like a static variable
|
||||||
|
|
@ -2058,7 +2059,7 @@ int V8Emitter::exitVariable(Node* n)
|
||||||
.replace("$jsgetter", state.variable(GETTER))
|
.replace("$jsgetter", state.variable(GETTER))
|
||||||
.replace("$jssetter", state.variable(SETTER))
|
.replace("$jssetter", state.variable(SETTER))
|
||||||
.trim()
|
.trim()
|
||||||
.pretty_print(f_init_wrappers);
|
.print(f_init_wrappers);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
@ -2088,14 +2089,14 @@ int V8Emitter::exitFunction(Node* n)
|
||||||
.replace("$jsname", state.function(NAME))
|
.replace("$jsname", state.function(NAME))
|
||||||
.replace("$jswrapper", state.function(WRAPPER_NAME))
|
.replace("$jswrapper", state.function(WRAPPER_NAME))
|
||||||
.trim()
|
.trim()
|
||||||
.pretty_print(f_init_static_wrappers);
|
.print(f_init_static_wrappers);
|
||||||
} else {
|
} else {
|
||||||
Template t_register = getTemplate("jsv8_register_member_function");
|
Template t_register = getTemplate("jsv8_register_member_function");
|
||||||
t_register.replace("$jsmangledname", state.clazz(NAME_MANGLED))
|
t_register.replace("$jsmangledname", state.clazz(NAME_MANGLED))
|
||||||
.replace("$jsname", state.function(NAME))
|
.replace("$jsname", state.function(NAME))
|
||||||
.replace("$jswrapper", state.function(WRAPPER_NAME))
|
.replace("$jswrapper", state.function(WRAPPER_NAME))
|
||||||
.trim()
|
.trim()
|
||||||
.pretty_print(f_init_wrappers);
|
.print(f_init_wrappers);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Note: a global function is treated like a static function
|
// Note: a global function is treated like a static function
|
||||||
|
|
@ -2423,6 +2424,11 @@ Template& Template::replace(const String *pattern, const String *repl) {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Template& Template::print(DOH *doh) {
|
||||||
|
Printv(doh, str(), 0);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
Template& Template::pretty_print(DOH *doh) {
|
Template& Template::pretty_print(DOH *doh) {
|
||||||
Wrapper_pretty_print(str(), doh);
|
Wrapper_pretty_print(str(), doh);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue