Added two-argument linearBreak
This commit is contained in:
Родитель
62529d1509
Коммит
17668e8a07
|
@ -2459,6 +2459,20 @@ void JS::PrettyPrinter::requiredBreak()
|
|||
}
|
||||
|
||||
|
||||
// If required is true, write a required line break; otherwise write a linear line break
|
||||
// of the given width.
|
||||
//
|
||||
// If this method throws an exception, it may have emitted partial output but
|
||||
// leaves the PrettyPrinter in a consistent state.
|
||||
void JS::PrettyPrinter::linearBreak(uint32 nSpaces, bool required)
|
||||
{
|
||||
if (required)
|
||||
requiredBreak();
|
||||
else
|
||||
linearBreak(nSpaces);
|
||||
}
|
||||
|
||||
|
||||
// Flush any saved output in the PrettyPrinter to the output. Call this just before
|
||||
// destroying the PrettyPrinter. All Indent and Block objects must have been exited already.
|
||||
//
|
||||
|
|
|
@ -1405,6 +1405,7 @@ namespace JavaScript {
|
|||
|
||||
void requiredBreak();
|
||||
void linearBreak(uint32 nSpaces) {conditionalBreak(nSpaces, Item::linearBreak);}
|
||||
void linearBreak(uint32 nSpaces, bool required);
|
||||
void fillBreak(uint32 nSpaces) {conditionalBreak(nSpaces, Item::fillBreak);}
|
||||
|
||||
void end();
|
||||
|
|
|
@ -2459,6 +2459,20 @@ void JS::PrettyPrinter::requiredBreak()
|
|||
}
|
||||
|
||||
|
||||
// If required is true, write a required line break; otherwise write a linear line break
|
||||
// of the given width.
|
||||
//
|
||||
// If this method throws an exception, it may have emitted partial output but
|
||||
// leaves the PrettyPrinter in a consistent state.
|
||||
void JS::PrettyPrinter::linearBreak(uint32 nSpaces, bool required)
|
||||
{
|
||||
if (required)
|
||||
requiredBreak();
|
||||
else
|
||||
linearBreak(nSpaces);
|
||||
}
|
||||
|
||||
|
||||
// Flush any saved output in the PrettyPrinter to the output. Call this just before
|
||||
// destroying the PrettyPrinter. All Indent and Block objects must have been exited already.
|
||||
//
|
||||
|
|
|
@ -1405,6 +1405,7 @@ namespace JavaScript {
|
|||
|
||||
void requiredBreak();
|
||||
void linearBreak(uint32 nSpaces) {conditionalBreak(nSpaces, Item::linearBreak);}
|
||||
void linearBreak(uint32 nSpaces, bool required);
|
||||
void fillBreak(uint32 nSpaces) {conditionalBreak(nSpaces, Item::fillBreak);}
|
||||
|
||||
void end();
|
||||
|
|
Загрузка…
Ссылка в новой задаче