Merge branch 'master' into fix-core-path-name-extension

This commit is contained in:
jockus
2020-08-27 08:24:59 +01:00
8 changed files with 88 additions and 12 deletions
+4 -7
View File
@@ -1654,13 +1654,10 @@ parse_field_list :: proc(p: ^Parser, follow: tokenizer.Token_Kind, allowed_flags
names := make([]^ast.Expr, 1);
names[0] = ast.new(ast.Ident, tok.pos, end_pos(tok));
switch ident in &names[0].derived {
case ast.Ident: {
ident.name = tok.text;
}
case: {
unreachable();
}
case ast.Ident:
ident.name = tok.text;
case:
unreachable();
}
flags := check_field_flag_prefixes(p, len(list), allowed_flags, eaf.flags);
+4 -2
View File
@@ -146,6 +146,7 @@ WALL_TO_INTERNAL :: i64((1884*365 + 1884/4 - 1884/100 + 1884/400) * SECONDS_PER_
INTERNAL_TO_WALL :: i64(- WALL_TO_INTERNAL);
UNIX_TO_ABSOLUTE :: i64(UNIX_TO_INTERNAL + INTERNAL_TO_ABSOLUTE);
ABSOLUTE_TO_UNIX :: i64(-UNIX_TO_ABSOLUTE);
_is_leap_year :: proc(year: int) -> bool {
return year%4 == 0 && (year%100 != 0 || year%400 == 0);
@@ -192,11 +193,12 @@ _abs_date :: proc(abs: u64, full: bool) -> (year: int, month: Month, day: int, y
}
day = yday;
if _is_leap_year(year) do switch {
case day < 31+29-1:
case day > 31+29-1:
day -= 1;
case day == 31+29-1:
month = Month.February;
month = .February;
day = 29;
return;
}