Skip to content

Commit

Permalink
Merge pull request #242 from sparkprime/formatter_warnings
Browse files Browse the repository at this point in the history
Fix warnings in formatter.cpp on travis osx
  • Loading branch information
sparkprime authored Oct 5, 2016
2 parents 7bce0f4 + 9f94774 commit 7faa145
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions core/formatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,14 +593,6 @@ static void fodder_move_front(Fodder &a, Fodder &b)
b.clear();
}

/** Move b to the back of a. */
static void fodder_move_back(Fodder &a, Fodder &b)
{
a = concat_fodder(a, b);
b.clear();
}


/** A generic Pass that does nothing but can be extended to easily define real passes.
*/
class Pass {
Expand Down Expand Up @@ -1337,12 +1329,11 @@ class PrettyFieldNames : public Pass {

class FixIndentation {

Allocator &alloc;
FmtOpts opts;
unsigned column;

public:
FixIndentation(Allocator &alloc, const FmtOpts &opts) : alloc(alloc), opts(opts) { }
FixIndentation(const FmtOpts &opts) : opts(opts) { }

void fill(Fodder &fodder, bool space_before, bool separate_token,
unsigned all_but_last_indent, unsigned last_indent)
Expand Down Expand Up @@ -1974,7 +1965,7 @@ std::string jsonnet_fmt(AST *ast, Fodder &final_fodder, const FmtOpts &opts)
if (opts.commentStyle != 'l')
EnforceCommentStyle(alloc, opts).file(ast, final_fodder);
if (opts.indent > 0)
FixIndentation(alloc, opts).file(ast, final_fodder);
FixIndentation(opts).file(ast, final_fodder);

std::stringstream ss;
Unparser unparser(ss, opts);
Expand Down

0 comments on commit 7faa145

Please sign in to comment.