Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hang parsing malformed properties #1107

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
]
},
"ghul.compiler": {
"version": "0.8.12",
"version": "0.8.13",
"commands": [
"ghul-compiler"
]
}
}
}
}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.8.13-alpha.6</Version>
<Version>0.8.14-alpha.7</Version>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/analysis/analyser.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ namespace Analysis is
reader: IO.TextReader,
writer: IO.TextWriter,
library_files: Iterable[string],
build_flags: BUILD_FLAGS
build_flags: BUILD_FLAGS,
watchdog: WATCHDOG
) is
_log = Std.error;
_timers = timers;
_symbol_table = symbol_table;

_command_map = new Collections.MAP[string,CommandHandler]();

let watchdog = new WATCHDOG();

_despatcher = new COMMAND_DESPATCHER(reader, writer, _timers, _log, watchdog);

build_flags.want_compile_up_to_expressions = true;
Expand Down
3 changes: 2 additions & 1 deletion src/driver/main.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ namespace Driver is
Std.`in,
Std.out,
analyse_files,
flags
flags,
container.watchdog
);

Std.error.write_line("ghūl compiler {compiler_version}: serving analysis requests");
Expand Down
2 changes: 2 additions & 0 deletions src/ioc/container.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace IoC is
logger_writer: IO.TextWriter;

timers: Logging.TIMERS;
watchdog: Analysis.WATCHDOG;

path_config: Driver.PATH_CONFIG;
build_flags: Compiler.BUILD_FLAGS;
Expand Down Expand Up @@ -117,6 +118,7 @@ namespace IoC is
want_human_readable_logger(Std.error);

timers = new Logging.TIMERS();
watchdog = new Analysis.WATCHDOG();

path_config = new Driver.PATH_CONFIG();
build_flags = new Compiler.BUILD_FLAGS();
Expand Down
7 changes: 3 additions & 4 deletions src/syntax/parsers/definitions/property.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,9 @@ namespace Syntax.Parsers.Definitions is
fi

if fail /\ !progress then
Std.error.write_line("parsing property: no progress made so consuming next token: {context.current_token_name}");
result.poison(true);

return result;
IO.Std.error.write_line("no progress parsing property at {context.location}");
IoC.CONTAINER.instance.watchdog.request_restart();
throw new System.Exception("no progress parsing property");
fi

result.poison(fail);
Expand Down
Loading