Update clang-format config, run it.

This commit is contained in:
Stefano Sanfilippo 2019-07-07 09:52:01 +02:00
parent 7a72294426
commit 08368b178c
8 changed files with 15 additions and 26 deletions

View File

@ -4,8 +4,10 @@ IndentWidth: 2
--- ---
Language: Cpp Language: Cpp
PointerAlignment: Left PointerAlignment: Left
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true AllowShortIfStatementsOnASingleLine: true
ColumnLimit: 100 ColumnLimit: 100
AlignEscapedNewlines: DontAlign AlignEscapedNewlines: DontAlign
BreakStringLiterals: false BreakStringLiterals: false
SpaceAfterTemplateKeyword: false SpaceAfterTemplateKeyword: false
SortIncludes: true

1
.gitignore vendored
View File

@ -1 +0,0 @@
/build

View File

@ -25,21 +25,13 @@ public:
moveTo(0, 0); moveTo(0, 0);
} }
void setColor(double r, double g, double b) { void setColor(double r, double g, double b) { cairo_set_source_rgb(context, r, g, b); }
cairo_set_source_rgb(context, r, g, b);
}
void setLineWidth(double size) { void setLineWidth(double size) { cairo_set_line_width(context, size); }
cairo_set_line_width(context, size);
}
void paint() { void paint() { cairo_paint(context); }
cairo_paint(context);
}
void moveTo(double x, double y) { void moveTo(double x, double y) { cairo_move_to(context, x, y); }
cairo_move_to(context, x, y);
}
void rectangleTo(double width, double height) { void rectangleTo(double width, double height) {
double baseX; double baseX;
@ -58,17 +50,13 @@ public:
moveTo(x, y); moveTo(x, y);
} }
void save(char const* filename) { void save(char const* filename) { cairo_surface_write_to_png(surface, filename); }
cairo_surface_write_to_png(surface, filename);
}
void save(std::string const& filename) { void save(std::string const& filename) { save(filename.c_str()); }
save(filename.c_str());
}
private: private:
cairo_surface_t *surface; cairo_surface_t* surface;
cairo_t *context; cairo_t* context;
}; };
static std::unique_ptr<Turtle> turtle; static std::unique_ptr<Turtle> turtle;

View File

@ -22,6 +22,6 @@
V(Module) \ V(Module) \
V(FunctionCallExpression) \ V(FunctionCallExpression) \
V(BinaryExpression) \ V(BinaryExpression) \
V(AtomicExpression) \ V(AtomicExpression)
#endif #endif

View File

@ -32,6 +32,6 @@
V(GE, OGE) \ V(GE, OGE) \
V(GT, OGT) \ V(GT, OGT) \
V(LE, OLE) \ V(LE, OLE) \
V(LT, OLT) \ V(LT, OLT)
#endif #endif

View File

@ -38,6 +38,6 @@
V(FUN_PARAMS, VOID) \ V(FUN_PARAMS, VOID) \
V(RETURN, VOID) \ V(RETURN, VOID) \
V(END, VOID) \ V(END, VOID) \
V(UNKNOWN, VOID) \ V(UNKNOWN, VOID)
#endif #endif

View File

@ -19,7 +19,7 @@
V(OP_PLUS, VOID) \ V(OP_PLUS, VOID) \
V(OP_MINUS, VOID) \ V(OP_MINUS, VOID) \
V(OP_TIMES, VOID) \ V(OP_TIMES, VOID) \
V(OP_DIV, VOID) \ V(OP_DIV, VOID)
// lexer_token, ast_operator, priority, representation // lexer_token, ast_operator, priority, representation
// All priorities must be STRICTLY LARGER than 0. // All priorities must be STRICTLY LARGER than 0.

View File

@ -11,6 +11,6 @@
V(CHAR, Int8, "%c", "%c", "Mascetti", "char") \ V(CHAR, Int8, "%c", "%c", "Mascetti", "char") \
V(FLOAT, Float, "%f", "%f\n", "Perozzi", "float") \ V(FLOAT, Float, "%f", "%f\n", "Perozzi", "float") \
V(BOOL, Int1, "%d", "%d\n", "Melandri", "bool") \ V(BOOL, Int1, "%d", "%d\n", "Melandri", "bool") \
V(DOUBLE, Double, "%lf", "%f\n", "Sassaroli", "double") \ V(DOUBLE, Double, "%lf", "%f\n", "Sassaroli", "double")
#endif #endif