Skip to content

Commit

Permalink
Remove debug output (#1099)
Browse files Browse the repository at this point in the history
Technical:
- Remove unwanted debug output
  • Loading branch information
degory committed Mar 2, 2024
1 parent 725ae33 commit 53645d7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"ghul.compiler": {
"version": "0.8.7",
"version": "0.8.8",
"commands": [
"ghul-compiler"
]
Expand Down
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.7-alpha.14</Version>
<Version>0.8.9-alpha.2</Version>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

Expand Down
3 changes: 3 additions & 0 deletions src/logging/diagnostics_store.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ namespace Logging is
speculate_then_backtrack() -> LOGGER_SPECULATE_THEN_BACKTRACK =>
new LOGGER_SPECULATE_THEN_BACKTRACK(self);

mark_then_release() -> MARK_THEN_RELEASE =>
new MARK_THEN_RELEASE(self);

merge(state: DIAGNOSTICS_STATE) is
top.merge(state);
si
Expand Down
45 changes: 14 additions & 31 deletions src/logging/logger.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ namespace Logging is

speculate_then_commit() -> LOGGER_SPECULATE_THEN_COMMIT;
speculate_then_backtrack() -> LOGGER_SPECULATE_THEN_BACKTRACK;
mark_then_release() -> MARK_THEN_RELEASE;

start_analysis();
end_analysis();
Expand Down Expand Up @@ -132,52 +133,36 @@ namespace Logging is
is_speculating: bool => _logger != null;

init(logger: Logger) is
debug_enter();
debug(">> logger speculate then commit...");

_logger = logger;
_logger.speculate();
si

backtrack() -> DIAGNOSTICS_STATE is
debug("-- logger state: explicit backtrack");

let result = _logger.roll_back();
_logger = null;
return result;
si

backtrack_and_restart() -> DIAGNOSTICS_STATE is
debug("-- logger state: explicit backtrack and restart");

let result = _logger.roll_back();
_logger.speculate();
return result;
si

commit() is
debug("-- logger state: explicit commit");

_logger.commit();
_logger = null;
si

cancel() is
debug("-- logger state: explicit cancel");

_logger = null;
si

dispose() is
if _logger != null then
debug("-- logger state: implicit commit");

_logger.commit();
_logger = null;
fi

debug("<< logger state exit");
debug_exit();
si
si

Expand All @@ -187,52 +172,50 @@ namespace Logging is
is_speculating: bool => _logger != null;

init(logger: Logger) is
debug_enter();
debug(">> logger speculate then backtrack...");

_logger = logger;
_logger.speculate();
si

backtrack() -> DIAGNOSTICS_STATE is
debug("-- logger state: explicit backtrack");

let result = _logger.roll_back();
_logger = null;
return result;
si

backtrack_and_restart() -> DIAGNOSTICS_STATE is
debug("-- logger state: explicit backtrack and restart");

let result = _logger.roll_back();
_logger.speculate();
return result;
si

commit() is
debug("-- logger state: explicit commit");

_logger.commit();
_logger = null;
si

cancel() is
debug("-- logger state: explicit cancel");

_logger = null;
si

dispose() is
if _logger != null then
debug("-- logger state: implicit backtrack");

_logger.roll_back();
_logger = null;
fi
si
si

debug("<< logger state exit");
debug_exit();
struct MARK_THEN_RELEASE: Disposable is
_logger: Logger;
_mark: int;

init(logger: Logger) is
_logger = logger;
_mark = _logger.mark();
si

dispose() is
_logger.release(_mark);
si
si
si
34 changes: 0 additions & 34 deletions src/syntax/parsers/context.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,43 @@ namespace Syntax.Parsers is
is_speculating: bool => _context != null;

init(context: CONTEXT) is
debug_enter();
debug(">> token lookahead speculate then commit...");

_context = context;
_context.tokenizer_speculate();
si

backtrack() is
debug("-- token lookahead state: explicit backtrack");

_context.tokenizer_backtrack();
_context = null;
si

backtrack_if_speculating() is
if _context != null then
debug("-- token lookahead state: explicit backtrack");

_context.tokenizer_backtrack();
_context = null;
fi
si

commit() is
debug("-- token lookahead state: explicit commit");

_context.tokenizer_commit();
_context = null;
si

commit_if_speculating() is
if _context != null then
debug("-- token lookahead state: explicit commit");

_context.tokenizer_commit();
_context = null;
fi
si

cancel() is
debug("-- token lookahead state: explicit cancel");
_context = null;
si

dispose() is
if _context != null then
debug("-- token lookahead state: implicit commit");
_context.tokenizer_commit();
_context = null;
fi

debug("<< token state exit");
debug_exit();
si
si

Expand All @@ -72,61 +56,43 @@ namespace Syntax.Parsers is
is_speculating: bool => _context != null;

init(context: CONTEXT) is
debug_enter();
debug(">> token lookahead speculate then backtrack...");

_context = context;
_context.tokenizer_speculate();
si

backtrack() is
debug("-- token lookahead state: explicit backtrack");

_context.tokenizer_backtrack();
_context = null;
si

backtrack_if_speculating() is
if _context != null then
debug("-- token lookahead state: explicit backtrack");

_context.tokenizer_backtrack();
_context = null;
fi
si

commit() is
debug("-- token lookahead state: explicit commit");

_context.tokenizer_commit();
_context = null;
si

commit_if_speculating() is
if _context != null then
debug("-- token lookahead state: explicit commit");

_context.tokenizer_commit();
_context = null;
fi
si

cancel() is
debug("-- token lookahead state: explicit cancel");

_context = null;
si

dispose() is
if _context != null then
debug("-- token lookahead state: implicit backtrack");

_context.tokenizer_backtrack();
_context = null;
fi

debug("<< token state exit");
debug_exit();
si
si

Expand Down
1 change: 0 additions & 1 deletion src/syntax/parsers/definitions/class.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ namespace Syntax.Parsers.Definitions is
return result;
finally
context.in_classy = false;
debug_exit();
yrt
si

Expand Down

0 comments on commit 53645d7

Please sign in to comment.