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
PointerAlignment: Left
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
ColumnLimit: 100
AlignEscapedNewlines: DontAlign
BreakStringLiterals: false
SpaceAfterTemplateKeyword: false
SortIncludes: true

1
.gitignore vendored
View File

@ -1 +0,0 @@
/build

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,6 +11,6 @@
V(CHAR, Int8, "%c", "%c", "Mascetti", "char") \
V(FLOAT, Float, "%f", "%f\n", "Perozzi", "float") \
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