aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.clang-format8
-rw-r--r--parse.c9
2 files changed, 9 insertions, 8 deletions
diff --git a/.clang-format b/.clang-format
index b80700c..35dc112 100644
--- a/.clang-format
+++ b/.clang-format
@@ -4,15 +4,13 @@ Language: Cpp
Standard: Latest
BasedOnStyle: LLVM
-AccessModifierOffset: -4
AlignEscapedNewlines: DontAlign
AlignTrailingComments: false
-AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
-AlwaysBreakTemplateDeclarations: Yes
BreakStringLiterals: false
ColumnLimit: 120
IndentWidth: 4
-KeepEmptyLinesAtTheStartOfBlocks: false
-MaxEmptyLinesToKeep: 1
+KeepEmptyLines:
+ AtStartOfBlock: false
+ AtStartOfFile: false
PointerAlignment: Left
diff --git a/parse.c b/parse.c
index a784898..61f701e 100644
--- a/parse.c
+++ b/parse.c
@@ -544,10 +544,12 @@ AstNode* parse_additive_expr(Parser* p) {
AstNode* rhs = parse_multiplicative_expr(p);
if (lhs->ty->base) {
lhs = ast_new_binary_expr(
- TokenKind_plus, lhs, ast_new_binary_expr(TokenKind_star, rhs, ast_new_int(type_sizeof(lhs->ty->base))));
+ TokenKind_plus, lhs,
+ ast_new_binary_expr(TokenKind_star, rhs, ast_new_int(type_sizeof(lhs->ty->base))));
} else if (rhs->ty->base) {
lhs = ast_new_binary_expr(
- TokenKind_plus, ast_new_binary_expr(TokenKind_star, lhs, ast_new_int(type_sizeof(rhs->ty->base))), rhs);
+ TokenKind_plus, ast_new_binary_expr(TokenKind_star, lhs, ast_new_int(type_sizeof(rhs->ty->base))),
+ rhs);
} else {
lhs = ast_new_binary_expr(TokenKind_plus, lhs, rhs);
}
@@ -561,7 +563,8 @@ AstNode* parse_additive_expr(Parser* p) {
} else {
// a - b*sizeof(a)
lhs = ast_new_binary_expr(
- TokenKind_minus, lhs, ast_new_binary_expr(TokenKind_star, rhs, ast_new_int(type_sizeof(lhs->ty->base))));
+ TokenKind_minus, lhs,
+ ast_new_binary_expr(TokenKind_star, rhs, ast_new_int(type_sizeof(lhs->ty->base))));
}
} else {
lhs = ast_new_binary_expr(TokenKind_minus, lhs, rhs);