From ca5ded11c8d57335c0463c63a2e942bec6a56f43 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Fri, 27 Sep 2024 15:34:00 +0200 Subject: [PATCH] Fix bug with captures groups. When extracting the data matching capture groups we'd take it from the beginning of the stream, not the beginning of the current view, even though the latter is what we are matching against. Closes #1846. (cherry picked from commit 5f14c360866abcd130508382f632386428654dda) # Conflicts: # spicy/toolchain/src/compiler/codegen/parsers/literals.cc --- hilti/lib/hilti.hlt | 2 +- hilti/runtime/include/types/regexp.h | 2 +- hilti/runtime/src/tests/regexp.cc | 16 ++--- hilti/runtime/src/types/regexp.cc | 4 +- .../src/compiler/codegen/parser-builder.cc | 14 +++- .../src/compiler/codegen/parsers/literals.cc | 2 +- .../Baseline/hilti.ast.basic-module/debug.log | 44 ++++++------ tests/Baseline/hilti.ast.coercion/output | 26 ++++--- tests/Baseline/hilti.ast.imported-id/output | 54 +++++++-------- tests/Baseline/hilti.ast.types/output | 26 ++++--- .../hilti.expressions.ctor-replacement/output | 26 ++++--- .../noopt.hlt | 68 ++++++++++--------- .../opt.hlt | 40 ++++++----- .../spicy.optimization.unused-types/log | 2 +- .../spicy.optimization.unused-types/noopt.hlt | 60 ++++++++-------- .../spicy.optimization.unused-types/opt.hlt | 16 +++-- .../output | 2 + .../.stderr | 38 +++++------ .../spicy.types.unit.skip-field/skips.txt | 6 +- .../spicy.types.unit.sub-unit/.stderr | 36 +++++----- .../regexp/parse-captures-requires.spicy | 15 ++++ 21 files changed, 266 insertions(+), 233 deletions(-) create mode 100644 tests/Baseline/spicy.types.regexp.parse-captures-requires/output create mode 100644 tests/spicy/types/regexp/parse-captures-requires.spicy diff --git a/hilti/lib/hilti.hlt b/hilti/lib/hilti.hlt index 7cfcf1fa0..021352d22 100644 --- a/hilti/lib/hilti.hlt +++ b/hilti/lib/hilti.hlt @@ -17,7 +17,7 @@ public type Captures = vector; public type Profiler = __library_type("hilti::rt::Profiler"); public type MatchState = struct { - method Captures captures(stream data); + method Captures captures(view data); } &cxxname="hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { diff --git a/hilti/runtime/include/types/regexp.h b/hilti/runtime/include/types/regexp.h index 75b02dc13..fa497e56d 100644 --- a/hilti/runtime/include/types/regexp.h +++ b/hilti/runtime/include/types/regexp.h @@ -107,7 +107,7 @@ class MatchState { * support for that, or when matching has not finished * successfully), the return vector will be empty. */ - Captures captures(const Stream& data) const; + Captures captures(const stream::View& data) const; private: // Returns (rc, bytes-consumed). Note that the latter can be negative if diff --git a/hilti/runtime/src/tests/regexp.cc b/hilti/runtime/src/tests/regexp.cc index df7f54386..df7097bd4 100644 --- a/hilti/runtime/src/tests/regexp.cc +++ b/hilti/runtime/src/tests/regexp.cc @@ -237,7 +237,7 @@ TEST_CASE("advance") { { auto ms_std_1 = re_std.tokenMatcher(); CHECK_EQ(ms_std_1.advance("Xa"_b, false), std::make_tuple(0, 0)); - CHECK_EQ(ms_std_1.captures(Stream("XabbbcdefgX"_b)), Vector()); + CHECK_EQ(ms_std_1.captures(Stream("XabbbcdefgX"_b).view()), Vector()); } { @@ -247,13 +247,13 @@ TEST_CASE("advance") { CHECK_EQ(ms_std_2.advance("bc"_b, false), std::make_tuple(-1, 2)); CHECK_EQ(ms_std_2.advance("de"_b, false), std::make_tuple(-1, 2)); CHECK_EQ(ms_std_2.advance("fgX"_b, true), std::make_tuple(1, 2)); - CHECK_EQ(ms_std_2.captures(Stream("abbbcdefg"_b)), Vector({"abbbcdefg"_b, "bbb"_b, "def"_b})); + CHECK_EQ(ms_std_2.captures(Stream("abbbcdefg"_b).view()), Vector({"abbbcdefg"_b, "bbb"_b, "def"_b})); } { auto ms_no_sub_1 = re_no_sub.tokenMatcher(); CHECK_EQ(ms_no_sub_1.advance("Xa"_b, false), std::make_tuple(0, 0)); - CHECK_EQ(ms_no_sub_1.captures(Stream("XabbbcdefgX"_b)), Vector()); + CHECK_EQ(ms_no_sub_1.captures(Stream("XabbbcdefgX"_b).view()), Vector()); } { @@ -263,7 +263,7 @@ TEST_CASE("advance") { CHECK_EQ(ms_no_sub_2.advance("bc"_b, false), std::make_tuple(-1, 2)); CHECK_EQ(ms_no_sub_2.advance("de"_b, false), std::make_tuple(-1, 2)); CHECK_EQ(ms_no_sub_2.advance("fgX"_b, true), std::make_tuple(1, 2)); - CHECK_EQ(ms_no_sub_2.captures(Stream("XabbbcdefgX"_b)), Vector()); + CHECK_EQ(ms_no_sub_2.captures(Stream("XabbbcdefgX"_b).view()), Vector()); } // Check that patterns stop when current match cannot be possible expanded anymore. @@ -284,27 +284,27 @@ TEST_CASE("advance") { { auto ms_std_1 = re_std.tokenMatcher(); CHECK_EQ(ms_std_1.advance("Xabbc"_b, false), std::make_tuple(0, 0)); - CHECK_EQ(ms_std_1.captures(Stream("XabbcyX"_b)), Vector({})); + CHECK_EQ(ms_std_1.captures(Stream("XabbcyX"_b).view()), Vector({})); } { auto ms_std_2 = re_std.tokenMatcher(); CHECK_EQ(ms_std_2.advance("abbc"_b, false), std::make_tuple(-1, 4)); CHECK_EQ(ms_std_2.advance("yX"_b, true), std::make_tuple(20, 1)); - CHECK_EQ(ms_std_2.captures(Stream("abbcyX"_b)), Vector({"abbcy"_b, "bbcy"_b})); + CHECK_EQ(ms_std_2.captures(Stream("abbcyX"_b).view()), Vector({"abbcy"_b, "bbcy"_b})); } { auto ms_no_sub_1 = re_no_sub.tokenMatcher(); CHECK_EQ(ms_no_sub_1.advance("Xabbc"_b, false), std::make_tuple(0, 0)); - CHECK_EQ(ms_no_sub_1.captures(Stream("XabbcyX"_b)), Vector({})); + CHECK_EQ(ms_no_sub_1.captures(Stream("XabbcyX"_b).view()), Vector({})); } { auto ms_no_sub_2 = re_no_sub.tokenMatcher(); CHECK_EQ(ms_no_sub_2.advance("abbc"_b, false), std::make_tuple(-1, 4)); CHECK_EQ(ms_no_sub_2.advance("yX"_b, true), std::make_tuple(20, 1)); - CHECK_EQ(ms_no_sub_2.captures(Stream("abbcyX"_b)), Vector({})); + CHECK_EQ(ms_no_sub_2.captures(Stream("abbcyX"_b).view()), Vector({})); } } diff --git a/hilti/runtime/src/types/regexp.cc b/hilti/runtime/src/types/regexp.cc index 41f03f58d..6623d7bb7 100644 --- a/hilti/runtime/src/types/regexp.cc +++ b/hilti/runtime/src/types/regexp.cc @@ -199,7 +199,7 @@ std::pair regexp::MatchState::_advance(const stream::View& dat return std::make_pair(_pimpl->_acc, _pimpl->_ms.offset - start_ms_offset); } -regexp::Captures regexp::MatchState::captures(const Stream& data) const { +regexp::Captures regexp::MatchState::captures(const stream::View& data) const { if ( _pimpl->_re->_flags.no_sub || _pimpl->_acc <= 0 || ! _pimpl->_done ) return Captures(); @@ -213,7 +213,7 @@ regexp::Captures regexp::MatchState::captures(const Stream& data) const { // internally as well: if not both are set, just skip (and // don't count) the group. if ( groups[i].rm_so >= 0 || groups[i].rm_eo >= 0 ) - captures.emplace_back(data.view(false).sub(groups[i].rm_so, groups[i].rm_eo).data()); + captures.emplace_back(data.sub(groups[i].rm_so, groups[i].rm_eo).data()); } } diff --git a/spicy/toolchain/src/compiler/codegen/parser-builder.cc b/spicy/toolchain/src/compiler/codegen/parser-builder.cc index 18f03bde3..8471132e8 100644 --- a/spicy/toolchain/src/compiler/codegen/parser-builder.cc +++ b/spicy/toolchain/src/compiler/codegen/parser-builder.cc @@ -585,11 +585,19 @@ struct ProductionVisitor : public production::Visitor { std::optional pre_container_offset; std::optional path_tracker; Expression* profiler = nullptr; + std::shared_ptr block; if ( is_field_owner ) { path_tracker = PathTracker(&_path, field->id()); auto offset = builder()->memberCall(state().cur, "offset"); profiler = builder()->startProfiler(fmt("spicy/unit/%s", hilti::util::join(_path, "::")), offset); + + if ( ! field->isAnonymous() ) { + // Set up a per-field block for scoping. + block = builder()->addBlock(); + pushBuilder(block); + } + pre_container_offset = preParseField(*p, meta); } @@ -636,9 +644,13 @@ struct ProductionVisitor : public production::Visitor { endProduction(*p); - if ( is_field_owner ) { + if ( is_field_owner ) postParseField(*p, meta, pre_container_offset); + if ( block ) + popBuilder(); // Per-field block. + + if ( is_field_owner ) { if ( profiler ) { auto offset = builder()->memberCall(state().cur, "offset"); builder()->stopProfiler(profiler, offset); diff --git a/spicy/toolchain/src/compiler/codegen/parsers/literals.cc b/spicy/toolchain/src/compiler/codegen/parsers/literals.cc index c6dce196f..e40d746f2 100644 --- a/spicy/toolchain/src/compiler/codegen/parsers/literals.cc +++ b/spicy/toolchain/src/compiler/codegen/parsers/literals.cc @@ -180,7 +180,7 @@ struct Visitor : public visitor::PreOrder { if ( state().literal_mode != LiteralMode::Skip ) { if ( state().captures ) builder()->addAssign(*state().captures, - builder()->memberCall(builder()->id("ms"), "captures", {state().data})); + builder()->memberCall(builder()->id("ms"), "captures", {state().cur})); builder()->addAssign(result, builder()->memberCall(state().cur, "sub", {builder()->begin(builder()->id("ncur"))})); diff --git a/tests/Baseline/hilti.ast.basic-module/debug.log b/tests/Baseline/hilti.ast.basic-module/debug.log index 9ce370fdd..aa3673f02 100644 --- a/tests/Baseline/hilti.ast.basic-module/debug.log +++ b/tests/Baseline/hilti.ast.basic-module/debug.log @@ -8,16 +8,16 @@ [debug/compiler] [HILTI] building scopes [debug/compiler] [HILTI] resolving AST [debug/compiler] -> modified -[debug/ast-stats] garbage collected 537 nodes in 12 rounds, 5272 left retained +[debug/ast-stats] garbage collected 545 nodes in 12 rounds, 5270 left retained [debug/compiler] processing ASTs, round 2 [debug/compiler] [HILTI] building scopes [debug/compiler] [HILTI] resolving AST [debug/compiler] -> modified -[debug/ast-stats] garbage collected 223 nodes in 11 rounds, 5528 left retained +[debug/ast-stats] garbage collected 223 nodes in 11 rounds, 5526 left retained [debug/compiler] processing ASTs, round 3 [debug/compiler] [HILTI] building scopes [debug/compiler] [HILTI] resolving AST -[debug/ast-stats] garbage collected 29 nodes in 2 rounds, 5556 left retained +[debug/ast-stats] garbage collected 29 nodes in 2 rounds, 5552 left retained [debug/ast-final] # [HILTI] Final AST (round 3) [debug/ast-final] - ASTRoot [no parent] () [@a:XXX] [debug/ast-final] | Foo -> declaration::Module [parent @a:XXX] [@d:XXX] ([@d:XXX]) @@ -444,23 +444,21 @@ [debug/ast-final] - type::ValueReference [parent @q:XXX] (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] [@q:XXX] [debug/ast-final] - AttributeSet [parent @d:XXX] [@a:XXX] -[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:42) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:42) [@q:XXX] -[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:42) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:48) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:48) [@q:XXX] +[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:48) (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:12-20:19) [@q:XXX] [debug/ast-final] - type::Name [parent @q:XXX] (hilti.hlt:20:12-20:19) (resolved) [@t:XXX] -[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:40) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::Stream [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:46) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] [debug/ast-final] - -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:41-20:40) [@a:XXX] -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:42-20:41) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:47-20:46) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:48-20:47) [@a:XXX] [debug/ast-final] - [debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] [debug/ast-final] - Attribute [parent @a:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] @@ -970,16 +968,16 @@ [debug/ast-final] [T15] hilti::RecoverableFailure [type::Exception] (hilti.hlt:56:34-56:56) [debug/ast-stats] # [HILTI] AST statistics: [debug/ast-stats] - # AST rounds 3 -[debug/ast-stats] - max tree depth: 16 +[debug/ast-stats] - max tree depth: 14 [debug/ast-stats] - # context declarations: 23 [debug/ast-stats] - # context types: 16 [debug/ast-stats] - # context modules: 2 -[debug/ast-stats] - # nodes reachable in AST: 705 -[debug/ast-stats] - # nodes live: 5556 -[debug/ast-stats] - # nodes retained: 5556 +[debug/ast-stats] - # nodes reachable in AST: 703 +[debug/ast-stats] - # nodes live: 5552 +[debug/ast-stats] - # nodes retained: 5552 [debug/ast-stats] - # nodes live > 1%: [debug/ast-stats] - AttributeSet: 64 -[debug/ast-stats] - QualifiedType: 1944 +[debug/ast-stats] - QualifiedType: 1942 [debug/ast-stats] - expression::Ctor: 69 [debug/ast-stats] - type::Bool: 140 [debug/ast-stats] - type::Bytes: 80 @@ -1000,4 +998,4 @@ [debug/compiler] codegen module Foo to C++ [debug/compiler] generating C++ for module Foo [debug/compiler] finalizing module Foo -[debug/ast-stats] garbage collected 5557 nodes in 17 rounds, 0 left retained +[debug/ast-stats] garbage collected 5553 nodes in 13 rounds, 0 left retained diff --git a/tests/Baseline/hilti.ast.coercion/output b/tests/Baseline/hilti.ast.coercion/output index 21cd0de90..fc0474250 100644 --- a/tests/Baseline/hilti.ast.coercion/output +++ b/tests/Baseline/hilti.ast.coercion/output @@ -600,23 +600,21 @@ [debug/ast-final] - type::ValueReference [parent @q:XXX] (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] [@q:XXX] [debug/ast-final] - AttributeSet [parent @d:XXX] [@a:XXX] -[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:42) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:42) [@q:XXX] -[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:42) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:48) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:48) [@q:XXX] +[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:48) (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:12-20:19) [@q:XXX] [debug/ast-final] - type::Name [parent @q:XXX] (hilti.hlt:20:12-20:19) (resolved) [@t:XXX] -[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:40) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::Stream [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:46) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] [debug/ast-final] - -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:41-20:40) [@a:XXX] -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:42-20:41) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:47-20:46) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:48-20:47) [@a:XXX] [debug/ast-final] - [debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] [debug/ast-final] - Attribute [parent @a:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] diff --git a/tests/Baseline/hilti.ast.imported-id/output b/tests/Baseline/hilti.ast.imported-id/output index 62d1f0a45..a24cbc16a 100644 --- a/tests/Baseline/hilti.ast.imported-id/output +++ b/tests/Baseline/hilti.ast.imported-id/output @@ -12,7 +12,7 @@ [debug/resolver] -> [T6] type::Enum | enum { } (hilti.hlt:13:24-13:46) [debug/resolver] -> [T7] type::Enum | enum { } (hilti.hlt:14:23-14:42) [debug/resolver] -> [T8] type::Enum | enum { } (hilti.hlt:15:35-15:66) -[debug/resolver] -> [T9] type::Struct | struct { method Captures captures(stream data); } (hilti.hlt:19:26-21:1) +[debug/resolver] -> [T9] type::Struct | struct { method Captures captures(view data); } (hilti.hlt:19:26-21:1) [debug/resolver] -> [T10] type::Struct | struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } (hilti.hlt:23:32-28:1) [debug/compiler] [HILTI] validating (pre) [debug/compiler] resolving units with plugin HILTI @@ -138,14 +138,14 @@ [debug/resolver] [hilti.hlt:17:24-17:60] type::Library "hilti::Profiler" -> set type's declaration to D12 [debug/resolver] [hilti.hlt:19:26-21:1] declaration::Expression "self" -> set declaration's canonical ID to hilti::self [debug/resolver] [hilti.hlt:19:26-21:1] declaration::Expression "self" -> set declaration's fully qualified ID to self -[debug/resolver] [hilti.hlt:20:30-20:40] declaration::Parameter "stream data" -> set declaration's canonical ID to hilti::data -[debug/resolver] [hilti.hlt:20:30-20:40] declaration::Parameter "stream data" -> set declaration's fully qualified ID to data -[debug/resolver] [hilti.hlt:20:5-20:42] declaration::Field "method Captures captures(stream data);" -> set declaration's canonical ID to hilti::captures -[debug/resolver] [hilti.hlt:20:5-20:42] declaration::Field "method Captures captures(stream data);" -> set linked type to T9 +[debug/resolver] [hilti.hlt:20:30-20:46] declaration::Parameter "view data" -> set declaration's canonical ID to hilti::data +[debug/resolver] [hilti.hlt:20:30-20:46] declaration::Parameter "view data" -> set declaration's fully qualified ID to data +[debug/resolver] [hilti.hlt:20:5-20:48] declaration::Field "method Captures captures(view data);" -> set declaration's canonical ID to hilti::captures +[debug/resolver] [hilti.hlt:20:5-20:48] declaration::Field "method Captures captures(view data);" -> set linked type to T9 [debug/resolver] [hilti.hlt:21:3-21:42] Attribute "&cxxname="hilti::rt::regexp::MatchState"" -> Attribute "&cxxname="::hilti::rt::regexp::MatchState"" -[debug/resolver] [hilti.hlt:19:1-21:43] declaration::Type "public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState";" -> set declaration's canonical ID to hilti::MatchState -[debug/resolver] [hilti.hlt:19:1-21:43] declaration::Type "public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState";" -> set declaration's fully qualified ID to hilti::MatchState -[debug/resolver] -> [D13] declaration::Type hilti::MatchState | public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState"; (hilti.hlt:19:1-21:43) +[debug/resolver] [hilti.hlt:19:1-21:43] declaration::Type "public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState";" -> set declaration's canonical ID to hilti::MatchState +[debug/resolver] [hilti.hlt:19:1-21:43] declaration::Type "public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState";" -> set declaration's fully qualified ID to hilti::MatchState +[debug/resolver] -> [D13] declaration::Type hilti::MatchState | public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState"; (hilti.hlt:19:1-21:43) [debug/resolver] [hilti.hlt:19:26-21:1] type::Struct "hilti::MatchState" -> set type's declaration to D13 [debug/resolver] [hilti.hlt:23:32-28:1] declaration::Expression "self" -> set declaration's canonical ID to hilti::self_2 [debug/resolver] [hilti.hlt:23:32-28:1] declaration::Expression "self" -> set declaration's fully qualified ID to self @@ -289,10 +289,10 @@ [debug/resolver] [hilti.hlt:67:1-67:119] declaration::Function "declare public function string exception_where(hilti::RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype;" -> set declaration's canonical ID to hilti::exception_where_2 [debug/resolver] [hilti.hlt:67:1-67:119] declaration::Function "declare public function string exception_where(hilti::RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype;" -> set declaration's fully qualified ID to hilti::exception_where [debug/resolver] [hilti.hlt:67:1-67:119] declaration::Function "declare public function string exception_where(hilti::RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype;" -> creating function call operator -[debug/resolver] [hilti.hlt:3:1-68:1] declaration::Module "module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; }" -> set declaration's fully qualified ID to hilti -[debug/resolver] [hilti.hlt:3:1-68:1] declaration::Module "module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; }" -> set module's canonical ID to hilti -[debug/resolver] -> [D20] declaration::Module hilti | module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; } (hilti.hlt:3:1-68:1) -[debug/resolver] [hilti.hlt:3:1-68:1] declaration::Module "module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(stream data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; }" -> set module's declaration index to D20 +[debug/resolver] [hilti.hlt:3:1-68:1] declaration::Module "module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; }" -> set declaration's fully qualified ID to hilti +[debug/resolver] [hilti.hlt:3:1-68:1] declaration::Module "module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; }" -> set module's canonical ID to hilti +[debug/resolver] -> [D20] declaration::Module hilti | module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; } (hilti.hlt:3:1-68:1) +[debug/resolver] [hilti.hlt:3:1-68:1] declaration::Module "module hilti { public type BitOrder = enum { LSB0 = 0, MSB0 = 1 } &cxxname="::hilti::rt::integer::BitOrder"; public type ByteOrder = enum { Little = 0, Big = 1, Network = 2, Host = 3 } &cxxname="::hilti::rt::ByteOrder"; public type Side = enum { Left = 0, Right = 1, Both = 2 } &cxxname="::hilti::rt::bytes::Side"; public type AddressFamily = enum { IPv4 = 0, IPv6 = 1 } &cxxname="::hilti::rt::AddressFamily"; public type RealType = enum { IEEE754_Single = 0, IEEE754_Double = 1 } &cxxname="::hilti::rt::real::Type"; public type Protocol = enum { TCP = 0, UDP = 1, ICMP = 2 } &cxxname="::hilti::rt::Protocol"; public type Charset = enum { ASCII = 0, UTF8 = 1 } &cxxname="::hilti::rt::bytes::Charset"; public type DecodeErrorStrategy = enum { IGNORE = 0, REPLACE = 1, STRICT = 2 } &cxxname="::hilti::rt::bytes::DecodeErrorStrategy"; public type Captures = vector; public type Profiler = Profiler &cxxname="::hilti::rt::Profiler"; public type MatchState = struct { method Captures captures(view data); } &cxxname="::hilti::rt::regexp::MatchState"; public type StreamStatistics = struct { uint<64> num_data_bytes; uint<64> num_data_chunks; uint<64> num_gap_bytes; uint<64> num_gap_chunks; } &cxxname="::hilti::rt::stream::Statistics"; public type Exception = exception &cxxname="::hilti::rt::Exception"; public type SystemException = [exception :Exception &cxxname="::std::exception"; public type RuntimeError = [exception :Exception &cxxname="::hilti::rt::RuntimeError"; public type RecoverableFailure = [exception :Exception &cxxname="::hilti::rt::RecoverableFailure"; public type MissingData = [exception :Exception &cxxname="::hilti::rt::MissingData"; declare public function void print(any obj, bool newline = True) &cxxname="::hilti::rt::print" &have_prototype; declare public function void printValues(tuple<*> t, bool newline = True) &cxxname="::hilti::rt::printValues" &have_prototype; declare public function void debug(string dbg_stream, any obj) &cxxname="::hilti::rt::debug::print" &have_prototype; declare public function void debugIndent(string dbg_stream) &cxxname="::hilti::rt::debug::indent" &have_prototype; declare public function void debugDedent(string dbg_stream) &cxxname="::hilti::rt::debug::dedent" &have_prototype; declare public function time current_time() &cxxname="::hilti::rt::time::current_time" &have_prototype; declare public function time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="::hilti::rt::time::mktime" &have_prototype; declare public function void abort() &cxxname="::hilti::rt::abort_with_backtrace" &have_prototype; declare public function optional profiler_start(string name, optional> size = Null) &cxxname="::hilti::rt::profiler::start" &have_prototype; declare public function void profiler_stop(optional p, optional> size = Null) &cxxname="::hilti::rt::profiler::stop" &have_prototype; declare public function string exception_what(SystemException excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_what(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::what" &have_prototype; declare public function string exception_where(SystemException excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; declare public function string exception_where(RecoverableFailure excpt) &cxxname="::hilti::rt::exception::where" &have_prototype; }" -> set module's declaration index to D20 [debug/resolver] [bar.hlt:4:1-4:11] declaration::ImportedModule "import Foo;" -> set declaration's canonical ID to Bar::Foo [debug/resolver] [bar.hlt:4:1-4:11] declaration::ImportedModule "import Foo;" -> set declaration's fully qualified ID to Bar::Foo [debug/resolver] [bar.hlt:4:1-4:11] declaration::ImportedModule "import Foo;" -> imported module Foo @@ -354,8 +354,8 @@ [debug/resolver] [hilti.hlt:15:35-15:66] declaration::Constant "const hilti::DecodeErrorStrategy REPLACE = hilti::DecodeErrorStrategy::REPLACE;" -> set declaration's fully qualified ID to hilti::DecodeErrorStrategy::REPLACE [debug/resolver] [hilti.hlt:15:35-15:66] declaration::Constant "const hilti::DecodeErrorStrategy STRICT = hilti::DecodeErrorStrategy::STRICT;" -> set declaration's fully qualified ID to hilti::DecodeErrorStrategy::STRICT [debug/resolver] [hilti.hlt:15:35-15:66] declaration::Constant "const hilti::DecodeErrorStrategy Undef = hilti::DecodeErrorStrategy::Undef;" -> set declaration's fully qualified ID to hilti::DecodeErrorStrategy::Undef -[debug/resolver] [hilti.hlt:20:5-20:42] declaration::Field "method Captures captures(stream data);" -> set declaration's fully qualified ID to hilti::MatchState::captures -[debug/resolver] [hilti.hlt:20:5-20:42] declaration::Field "method Captures captures(stream data);" -> creating member call operator +[debug/resolver] [hilti.hlt:20:5-20:48] declaration::Field "method Captures captures(view data);" -> set declaration's fully qualified ID to hilti::MatchState::captures +[debug/resolver] [hilti.hlt:20:5-20:48] declaration::Field "method Captures captures(view data);" -> creating member call operator [debug/resolver] [hilti.hlt:24:5-24:28] declaration::Field "uint<64> num_data_bytes;" -> set declaration's fully qualified ID to hilti::StreamStatistics::num_data_bytes [debug/resolver] [hilti.hlt:25:5-25:29] declaration::Field "uint<64> num_data_chunks;" -> set declaration's fully qualified ID to hilti::StreamStatistics::num_data_chunks [debug/resolver] [hilti.hlt:26:5-26:27] declaration::Field "uint<64> num_gap_bytes;" -> set declaration's fully qualified ID to hilti::StreamStatistics::num_gap_bytes @@ -805,23 +805,21 @@ [debug/ast-final] - type::ValueReference [parent @q:XXX] (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] [@q:XXX] [debug/ast-final] - AttributeSet [parent @d:XXX] [@a:XXX] -[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:42) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:42) [@q:XXX] -[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:42) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:48) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:48) [@q:XXX] +[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:48) (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:12-20:19) [@q:XXX] [debug/ast-final] - type::Name [parent @q:XXX] (hilti.hlt:20:12-20:19) (resolved) [@t:XXX] -[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:40) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::Stream [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:46) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] [debug/ast-final] - -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:41-20:40) [@a:XXX] -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:42-20:41) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:47-20:46) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:48-20:47) [@a:XXX] [debug/ast-final] - [debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] [debug/ast-final] - Attribute [parent @a:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] diff --git a/tests/Baseline/hilti.ast.types/output b/tests/Baseline/hilti.ast.types/output index 09de03a8c..b71e3def3 100644 --- a/tests/Baseline/hilti.ast.types/output +++ b/tests/Baseline/hilti.ast.types/output @@ -465,23 +465,21 @@ [debug/ast-final] - type::ValueReference [parent @q:XXX] (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] [@q:XXX] [debug/ast-final] - AttributeSet [parent @d:XXX] [@a:XXX] -[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:42) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:42) [@q:XXX] -[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:42) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:48) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:48) [@q:XXX] +[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:48) (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:12-20:19) [@q:XXX] [debug/ast-final] - type::Name [parent @q:XXX] (hilti.hlt:20:12-20:19) (resolved) [@t:XXX] -[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:40) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::Stream [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:46) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] [debug/ast-final] - -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:41-20:40) [@a:XXX] -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:42-20:41) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:47-20:46) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:48-20:47) [@a:XXX] [debug/ast-final] - [debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] [debug/ast-final] - Attribute [parent @a:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] diff --git a/tests/Baseline/hilti.expressions.ctor-replacement/output b/tests/Baseline/hilti.expressions.ctor-replacement/output index eb0d6d6fd..ad6efbd40 100644 --- a/tests/Baseline/hilti.expressions.ctor-replacement/output +++ b/tests/Baseline/hilti.expressions.ctor-replacement/output @@ -429,23 +429,21 @@ [debug/ast-final] - type::ValueReference [parent @q:XXX] (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] [@q:XXX] [debug/ast-final] - AttributeSet [parent @d:XXX] [@a:XXX] -[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:42) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:42) [@q:XXX] -[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:42) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Field [parent @t:XXX] (hilti.hlt:20:5-20:48) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:5-20:48) [@q:XXX] +[debug/ast-final] - type::Function [parent @q:XXX] (hilti.hlt:20:5-20:48) (resolved) [@t:XXX] [debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:12-20:19) [@q:XXX] [debug/ast-final] - type::Name [parent @q:XXX] (hilti.hlt:20:12-20:19) (resolved) [@t:XXX] -[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:40) (resolved) [@d:XXX] -[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::Stream [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] -[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:30-20:35) [@q:XXX] -[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:30-20:35) (resolved) [@t:XXX] +[debug/ast-final] - declaration::Parameter [parent @t:XXX] (hilti.hlt:20:30-20:46) (resolved) [@d:XXX] +[debug/ast-final] - QualifiedType [parent @d:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::View [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::stream::Iterator [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] +[debug/ast-final] - QualifiedType [parent @t:XXX] (hilti.hlt:20:35-20:40) [@q:XXX] +[debug/ast-final] - type::UnsignedInteger [parent @q:XXX] (hilti.hlt:20:35-20:40) (resolved) [@t:XXX] [debug/ast-final] - -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:41-20:40) [@a:XXX] -[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:42-20:41) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:47-20:46) [@a:XXX] +[debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:20:48-20:47) [@a:XXX] [debug/ast-final] - [debug/ast-final] - AttributeSet [parent @d:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] [debug/ast-final] - Attribute [parent @a:XXX] (hilti.hlt:21:2-21:1) [@a:XXX] diff --git a/tests/Baseline/spicy.optimization.default-parser-functions/noopt.hlt b/tests/Baseline/spicy.optimization.default-parser-functions/noopt.hlt index 9233491db..5242a1f72 100644 --- a/tests/Baseline/spicy.optimization.default-parser-functions/noopt.hlt +++ b/tests/Baseline/spicy.optimization.default-parser-functions/noopt.hlt @@ -733,32 +733,34 @@ method method tuple, int<64>, const iterator, optiona # "<...>/default-parser-functions.spicy:16:18-21:1" local tuple, int<64>, const iterator, optional> __result; # "<...>/default-parser-functions.spicy:17:8-17:12" + { + # Begin parsing production: Variable: x -> uint<8> + spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:17:8-17:12", ::__feat%foo@@P2%supports_filters ? (*self).__filters : Null); + ((*self).x, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); - # Begin parsing production: Variable: x -> uint<8> - spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:17:8-17:12", ::__feat%foo@@P2%supports_filters ? (*self).__filters : Null); - ((*self).x, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); + if ( __trim ) + (*__data).trim(begin(__cur)); - if ( __trim ) - (*__data).trim(begin(__cur)); + # End parsing production: Variable: x -> uint<8> - # End parsing production: Variable: x -> uint<8> + (*self).__error = __error; - (*self).__error = __error; + if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) + (*self).__position_update = Null; - if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) - (*self).__position_update = Null; + (*self).__on_x((*self).x); - (*self).__on_x((*self).x); + if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) - if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) + if ( (*self).__position_update ) { + __cur = __cur.advance((*(*self).__position_update)); + (*self).__position_update = Null; + } - if ( (*self).__position_update ) { - __cur = __cur.advance((*(*self).__position_update)); - (*self).__position_update = Null; - } + __error = (*self).__error; + } - __error = (*self).__error; if ( ::__feat%foo@@P2%uses_random_access ) (*self).__begin = __begin; @@ -768,32 +770,34 @@ method method tuple, int<64>, const iterator, optiona (*self).__offset = cast>(begin(__cur).offset() - __begin.offset()); # "<...>/default-parser-functions.spicy:18:8-18:12" + { + # Begin parsing production: Variable: y -> uint<8> + spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:18:8-18:12", ::__feat%foo@@P2%supports_filters ? (*self).__filters : Null); + ((*self).y, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); - # Begin parsing production: Variable: y -> uint<8> - spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:18:8-18:12", ::__feat%foo@@P2%supports_filters ? (*self).__filters : Null); - ((*self).y, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); + if ( __trim ) + (*__data).trim(begin(__cur)); - if ( __trim ) - (*__data).trim(begin(__cur)); + # End parsing production: Variable: y -> uint<8> - # End parsing production: Variable: y -> uint<8> + (*self).__error = __error; - (*self).__error = __error; + if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) + (*self).__position_update = Null; - if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) - (*self).__position_update = Null; + (*self).__on_y((*self).y); - (*self).__on_y((*self).y); + if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) - if ( ::__feat%foo@@P2%uses_random_access || ::__feat%foo@@P2%uses_offset ) + if ( (*self).__position_update ) { + __cur = __cur.advance((*(*self).__position_update)); + (*self).__position_update = Null; + } - if ( (*self).__position_update ) { - __cur = __cur.advance((*(*self).__position_update)); - (*self).__position_update = Null; - } + __error = (*self).__error; + } - __error = (*self).__error; if ( ::__feat%foo@@P2%uses_random_access ) (*self).__begin = __begin; diff --git a/tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt b/tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt index 274ea7734..9d072d3ec 100644 --- a/tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt +++ b/tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt @@ -196,33 +196,37 @@ method method tuple, int<64>, const iterator, optiona # "<...>/default-parser-functions.spicy:16:18-21:1" local tuple, int<64>, const iterator, optional> __result; # "<...>/default-parser-functions.spicy:17:8-17:12" + { + # Begin parsing production: Variable: x -> uint<8> + spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:17:8-17:12", Null); + ((*self).x, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); - # Begin parsing production: Variable: x -> uint<8> - spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:17:8-17:12", Null); - ((*self).x, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); + if ( __trim ) + (*__data).trim(begin(__cur)); - if ( __trim ) - (*__data).trim(begin(__cur)); + # End parsing production: Variable: x -> uint<8> - # End parsing production: Variable: x -> uint<8> + (*self).__error = __error; + default(); + __error = (*self).__error; + } - (*self).__error = __error; - default(); - __error = (*self).__error; # "<...>/default-parser-functions.spicy:18:8-18:12" + { + # Begin parsing production: Variable: y -> uint<8> + spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:18:8-18:12", Null); + ((*self).y, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); - # Begin parsing production: Variable: y -> uint<8> - spicy_rt::waitForInput(__data, __cur, 1, "expecting 1 bytes for unpacking value", "<...>/default-parser-functions.spicy:18:8-18:12", Null); - ((*self).y, __cur) = (*unpack>((__cur, hilti::ByteOrder::Network))); + if ( __trim ) + (*__data).trim(begin(__cur)); - if ( __trim ) - (*__data).trim(begin(__cur)); + # End parsing production: Variable: y -> uint<8> - # End parsing production: Variable: y -> uint<8> + (*self).__error = __error; + (*self).__on_y((*self).y); + __error = (*self).__error; + } - (*self).__error = __error; - (*self).__on_y((*self).y); - __error = (*self).__error; (*self).__error = __error; default(); __error = (*self).__error; diff --git a/tests/Baseline/spicy.optimization.unused-types/log b/tests/Baseline/spicy.optimization.unused-types/log index cd1a8e851..de853c408 100644 --- a/tests/Baseline/spicy.optimization.unused-types/log +++ b/tests/Baseline/spicy.optimization.unused-types/log @@ -942,7 +942,7 @@ [debug/optimizer] [unused-types.spicy:21:14-24:1] declaration::Function "method extern method view foo::Priv4::parse1(inout value_ref __data, optional> __cur = Null, optional __context) &needed-by-feature="is_filter" &needed-by-feature="supports_sinks" &static { # "<...>/unused-types.spicy:21:14-24:1" local value_ref __unit = value_ref(default()); local view __ncur = __cur ? (*__cur) : cast>((*__data)); local int<64> __lahead = 0; local iterator __lahead_end; local optional __error = Null; # "<...>/unused-types.spicy:21:14-24:1" # Begin parsing production: Unit: foo__Priv4 -> Resolved_6 Resolved_7 (__ncur, __lahead, __lahead_end, __error) = (*__unit).__parse_stage1(__data, begin(__ncur), __ncur, True, __lahead, __lahead_end, __error); # End parsing production: Unit: foo__Priv4 -> Resolved_6 Resolved_7 if ( __error ) throw ; return __ncur; }" -> null (removing declaration for unused function) [debug/optimizer] [unused-types.spicy:21:14-24:1] declaration::Function "method extern method view foo::Priv4::parse2(inout value_ref __unit, inout value_ref __data, optional> __cur = Null, optional __context) &needed-by-feature="is_filter" &needed-by-feature="supports_sinks" &static { # "<...>/unused-types.spicy:21:14-24:1" local view __ncur = __cur ? (*__cur) : cast>((*__data)); local int<64> __lahead = 0; local iterator __lahead_end; local optional __error = Null; # "<...>/unused-types.spicy:21:14-24:1" # Begin parsing production: Unit: foo__Priv4 -> Resolved_6 Resolved_7 (__ncur, __lahead, __lahead_end, __error) = (*__unit).__parse_stage1(__data, begin(__ncur), __ncur, True, __lahead, __lahead_end, __error); # End parsing production: Unit: foo__Priv4 -> Resolved_6 Resolved_7 if ( __error ) throw ; return __ncur; }" -> null (removing declaration for unused function) [debug/optimizer] [unused-types.spicy:21:14-24:1] declaration::Function "method extern method view foo::Priv4::parse3(inout value_ref __gunit, inout value_ref __data, optional> __cur = Null, optional __context) &needed-by-feature="is_filter" &needed-by-feature="supports_sinks" &static { # "<...>/unused-types.spicy:21:14-24:1" local value_ref __unit = value_ref(default()); spicy_rt::initializeParsedUnit((*__gunit), __unit, typeinfo(foo::Priv4)); local view __ncur = __cur ? (*__cur) : cast>((*__data)); local int<64> __lahead = 0; local iterator __lahead_end; local optional __error = Null; # "<...>/unused-types.spicy:21:14-24:1" # Begin parsing production: Unit: foo__Priv4 -> Resolved_6 Resolved_7 (__ncur, __lahead, __lahead_end, __error) = (*__unit).__parse_stage1(__data, begin(__ncur), __ncur, True, __lahead, __lahead_end, __error); # End parsing production: Unit: foo__Priv4 -> Resolved_6 Resolved_7 if ( __error ) throw ; return __ncur; }" -> null (removing declaration for unused function) -[debug/optimizer] [unused-types.spicy:21:14-24:1] declaration::Function "method method tuple, int<64>, const iterator, optional> foo::Priv4::__parse_foo__Priv4_stage2(inout value_ref __data, iterator __begin, copy view __cur, copy bool __trim, copy int<64> __lah, copy iterator __lahe, copy optional __error) { # "<...>/unused-types.spicy:21:14-24:1" local tuple, int<64>, const iterator, optional> __result; local value_ref __transient__anon; # "<...>/unused-types.spicy:19:14-19:20" # Begin parsing production: Unit: foo__Priv2_2 -> __transient__anon = default(); (__cur, __lah, __lahe, __error) = (*__transient__anon).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); # End parsing production: Unit: foo__Priv2_2 -> # "<...>/unused-types.spicy:20:14-20:20" # Begin parsing production: Unit: foo__Priv3_2 -> (*self).x = default(); (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); # End parsing production: Unit: foo__Priv3_2 -> (*self).__error = __error; default(); __error = (*self).__error; (*self).__error = __error; default(); __error = (*self).__error; hilti::debugDedent("spicy"); __result = (__cur, __lah, __lahe, __error); return __result; }" -> null (removing declaration for unused function) +[debug/optimizer] [unused-types.spicy:21:14-24:1] declaration::Function "method method tuple, int<64>, const iterator, optional> foo::Priv4::__parse_foo__Priv4_stage2(inout value_ref __data, iterator __begin, copy view __cur, copy bool __trim, copy int<64> __lah, copy iterator __lahe, copy optional __error) { # "<...>/unused-types.spicy:21:14-24:1" local tuple, int<64>, const iterator, optional> __result; local value_ref __transient__anon; # "<...>/unused-types.spicy:19:14-19:20" # Begin parsing production: Unit: foo__Priv2_2 -> __transient__anon = default(); (__cur, __lah, __lahe, __error) = (*__transient__anon).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); # End parsing production: Unit: foo__Priv2_2 -> # "<...>/unused-types.spicy:20:14-20:20" { # Begin parsing production: Unit: foo__Priv3_2 -> (*self).x = default(); (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); # End parsing production: Unit: foo__Priv3_2 -> (*self).__error = __error; default(); __error = (*self).__error; } (*self).__error = __error; default(); __error = (*self).__error; hilti::debugDedent("spicy"); __result = (__cur, __lah, __lahe, __error); return __result; }" -> null (removing declaration for unused function) [debug/optimizer] [unused-types.spicy:21:14-24:1] declaration::Function "method method tuple, int<64>, const iterator, optional> foo::Priv4::__parse_stage1(inout value_ref __data, iterator __begin, copy view __cur, copy bool __trim, copy int<64> __lah, copy iterator __lahe, copy optional __error) { # "<...>/unused-types.spicy:21:14-24:1" local tuple, int<64>, const iterator, optional> __result; try { hilti::debugIndent("spicy"); local iterator __begin = begin(__cur); (*self).__error = __error; default(); __error = (*self).__error; local strong_ref filtered = Null; if ( ! filtered ) __result = (*self).__parse_foo__Priv4_stage2(__data, __begin, __cur, __trim, __lah, __lahe, __error); } catch ( hilti::SystemException __except ) { default(); (*self).__error = __error; default(); __error = (*self).__error; throw; } (*self).__error = __error; default(); __error = (*self).__error; return __result; }" -> null (removing declaration for unused function) [debug/optimizer] [unused-types.spicy:21:14-24:1] operator_::struct_::MemberCall "(*self).__on_0x25_done()" -> expression::Ctor "default()" (replacing call to unimplemented method with default value) [debug/optimizer] [unused-types.spicy:21:14-24:1] operator_::struct_::MemberCall "(*self).__on_0x25_error(hilti::exception_what(__except))" -> expression::Ctor "default()" (replacing call to unimplemented method with default value) diff --git a/tests/Baseline/spicy.optimization.unused-types/noopt.hlt b/tests/Baseline/spicy.optimization.unused-types/noopt.hlt index 5c98317d5..40882abb9 100644 --- a/tests/Baseline/spicy.optimization.unused-types/noopt.hlt +++ b/tests/Baseline/spicy.optimization.unused-types/noopt.hlt @@ -1463,28 +1463,30 @@ method method tuple, int<64>, const iterator, optiona (*self).__offset = cast>(begin(__cur).offset() - __begin.offset()); # "<...>/unused-types.spicy:20:14-20:20" + { + # Begin parsing production: Unit: foo__Priv3_2 -> + (*self).x = default(); + (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); + # End parsing production: Unit: foo__Priv3_2 -> - # Begin parsing production: Unit: foo__Priv3_2 -> - (*self).x = default(); - (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); - # End parsing production: Unit: foo__Priv3_2 -> + (*self).__error = __error; - (*self).__error = __error; + if ( ::__feat%foo@@Priv4%uses_random_access || ::__feat%foo@@Priv4%uses_offset ) + (*self).__position_update = Null; - if ( ::__feat%foo@@Priv4%uses_random_access || ::__feat%foo@@Priv4%uses_offset ) - (*self).__position_update = Null; + (*self).__on_x((*self).x); - (*self).__on_x((*self).x); + if ( ::__feat%foo@@Priv4%uses_random_access || ::__feat%foo@@Priv4%uses_offset ) - if ( ::__feat%foo@@Priv4%uses_random_access || ::__feat%foo@@Priv4%uses_offset ) + if ( (*self).__position_update ) { + __cur = __cur.advance((*(*self).__position_update)); + (*self).__position_update = Null; + } - if ( (*self).__position_update ) { - __cur = __cur.advance((*(*self).__position_update)); - (*self).__position_update = Null; - } + __error = (*self).__error; + } - __error = (*self).__error; if ( ::__feat%foo@@Priv4%uses_random_access ) (*self).__begin = __begin; @@ -2247,28 +2249,30 @@ method method tuple, int<64>, const iterator, optiona (*self).__offset = cast>(begin(__cur).offset() - __begin.offset()); # "<...>/unused-types.spicy:28:14-28:20" + { + # Begin parsing production: Unit: foo__Priv6_2 -> + (*self).x = default(); + (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); + # End parsing production: Unit: foo__Priv6_2 -> - # Begin parsing production: Unit: foo__Priv6_2 -> - (*self).x = default(); - (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); - # End parsing production: Unit: foo__Priv6_2 -> + (*self).__error = __error; - (*self).__error = __error; + if ( ::__feat%foo@@Pub3%uses_random_access || ::__feat%foo@@Pub3%uses_offset ) + (*self).__position_update = Null; - if ( ::__feat%foo@@Pub3%uses_random_access || ::__feat%foo@@Pub3%uses_offset ) - (*self).__position_update = Null; + (*self).__on_x((*self).x); - (*self).__on_x((*self).x); + if ( ::__feat%foo@@Pub3%uses_random_access || ::__feat%foo@@Pub3%uses_offset ) - if ( ::__feat%foo@@Pub3%uses_random_access || ::__feat%foo@@Pub3%uses_offset ) + if ( (*self).__position_update ) { + __cur = __cur.advance((*(*self).__position_update)); + (*self).__position_update = Null; + } - if ( (*self).__position_update ) { - __cur = __cur.advance((*(*self).__position_update)); - (*self).__position_update = Null; - } + __error = (*self).__error; + } - __error = (*self).__error; if ( ::__feat%foo@@Pub3%uses_random_access ) (*self).__begin = __begin; diff --git a/tests/Baseline/spicy.optimization.unused-types/opt.hlt b/tests/Baseline/spicy.optimization.unused-types/opt.hlt index ba7b2e124..fa22e35cf 100644 --- a/tests/Baseline/spicy.optimization.unused-types/opt.hlt +++ b/tests/Baseline/spicy.optimization.unused-types/opt.hlt @@ -368,15 +368,17 @@ method method tuple, int<64>, const iterator, optiona # End parsing production: Unit: foo__Priv5_2 -> # "<...>/unused-types.spicy:28:14-28:20" + { + # Begin parsing production: Unit: foo__Priv6_2 -> + (*self).x = default(); + (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); + # End parsing production: Unit: foo__Priv6_2 -> - # Begin parsing production: Unit: foo__Priv6_2 -> - (*self).x = default(); - (__cur, __lah, __lahe, __error) = (*(*self).x).__parse_stage1(__data, __begin, __cur, __trim, __lah, __lahe, __error); - # End parsing production: Unit: foo__Priv6_2 -> + (*self).__error = __error; + default(); + __error = (*self).__error; + } - (*self).__error = __error; - default(); - __error = (*self).__error; (*self).__error = __error; default(); __error = (*self).__error; diff --git a/tests/Baseline/spicy.types.regexp.parse-captures-requires/output b/tests/Baseline/spicy.types.regexp.parse-captures-requires/output new file mode 100644 index 000000000..068772faf --- /dev/null +++ b/tests/Baseline/spicy.types.regexp.parse-captures-requires/output @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +[$a=b"b", $b=b"abc"] diff --git a/tests/Baseline/spicy.types.unit.hooks-across-imports/.stderr b/tests/Baseline/spicy.types.unit.hooks-across-imports/.stderr index 81dfbc714..eff5ae159 100644 --- a/tests/Baseline/spicy.types.unit.hooks-across-imports/.stderr +++ b/tests/Baseline/spicy.types.unit.hooks-across-imports/.stderr @@ -1,22 +1,22 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -[debug/ast-stats] garbage collected 1072 nodes in 12 rounds, 7974 left retained -[debug/ast-stats] garbage collected 479 nodes in 11 rounds, 9128 left retained -[debug/ast-stats] garbage collected 170 nodes in 6 rounds, 9531 left retained -[debug/ast-stats] garbage collected 78 nodes in 3 rounds, 9531 left retained -[debug/ast-stats] garbage collected 78 nodes in 3 rounds, 9531 left retained +[debug/ast-stats] garbage collected 1080 nodes in 12 rounds, 7972 left retained +[debug/ast-stats] garbage collected 479 nodes in 11 rounds, 9126 left retained +[debug/ast-stats] garbage collected 170 nodes in 6 rounds, 9527 left retained +[debug/ast-stats] garbage collected 78 nodes in 3 rounds, 9527 left retained +[debug/ast-stats] garbage collected 78 nodes in 3 rounds, 9527 left retained [debug/ast-stats] # [Spicy] AST statistics: [debug/ast-stats] - # AST rounds 5 [debug/ast-stats] - max tree depth: 16 [debug/ast-stats] - # context declarations: 67 [debug/ast-stats] - # context types: 47 [debug/ast-stats] - # context modules: 5 -[debug/ast-stats] - # nodes reachable in AST: 3095 -[debug/ast-stats] - # nodes live: 9531 -[debug/ast-stats] - # nodes retained: 9531 +[debug/ast-stats] - # nodes reachable in AST: 3093 +[debug/ast-stats] - # nodes live: 9527 +[debug/ast-stats] - # nodes retained: 9527 [debug/ast-stats] - # nodes live > 1%: [debug/ast-stats] - Attribute: 167 [debug/ast-stats] - AttributeSet: 328 -[debug/ast-stats] - QualifiedType: 3219 +[debug/ast-stats] - QualifiedType: 3217 [debug/ast-stats] - ctor::String: 118 [debug/ast-stats] - declaration::Parameter: 127 [debug/ast-stats] - expression::Ctor: 207 @@ -32,24 +32,24 @@ [debug/ast-stats] - type::bytes::Iterator: 175 [debug/ast-stats] - type::operand_list::Operand: 1224 [debug/ast-stats] - type::stream::Iterator: 133 -[debug/ast-stats] garbage collected 10026 nodes in 14 rounds, 21409 left retained -[debug/ast-stats] garbage collected 2318 nodes in 16 rounds, 25227 left retained -[debug/ast-stats] garbage collected 2354 nodes in 8 rounds, 26645 left retained -[debug/ast-stats] garbage collected 4558 nodes in 11 rounds, 27837 left retained -[debug/ast-stats] garbage collected 420 nodes in 3 rounds, 27837 left retained +[debug/ast-stats] garbage collected 10026 nodes in 14 rounds, 21411 left retained +[debug/ast-stats] garbage collected 2318 nodes in 16 rounds, 25229 left retained +[debug/ast-stats] garbage collected 2354 nodes in 8 rounds, 26647 left retained +[debug/ast-stats] garbage collected 4558 nodes in 11 rounds, 27839 left retained +[debug/ast-stats] garbage collected 420 nodes in 3 rounds, 27839 left retained [debug/ast-stats] # [HILTI] AST statistics: [debug/ast-stats] - # AST rounds 5 [debug/ast-stats] - max tree depth: 27 [debug/ast-stats] - # context declarations: 262 [debug/ast-stats] - # context types: 55 [debug/ast-stats] - # context modules: 8 -[debug/ast-stats] - # nodes reachable in AST: 19057 -[debug/ast-stats] - # nodes live: 27837 -[debug/ast-stats] - # nodes retained: 27837 +[debug/ast-stats] - # nodes reachable in AST: 19061 +[debug/ast-stats] - # nodes live: 27839 +[debug/ast-stats] - # nodes retained: 27839 [debug/ast-stats] - # nodes live > 1%: [debug/ast-stats] - Attribute: 297 [debug/ast-stats] - AttributeSet: 752 -[debug/ast-stats] - QualifiedType: 9176 +[debug/ast-stats] - QualifiedType: 9174 [debug/ast-stats] - declaration::Parameter: 388 [debug/ast-stats] - expression::Ctor: 804 [debug/ast-stats] - expression::Member: 342 @@ -66,5 +66,5 @@ [debug/ast-stats] - type::stream::Iterator: 1023 [debug/ast-stats] - type::stream::View: 557 [debug/ast-stats] - type::tuple::Element: 675 -[debug/ast-stats] garbage collected 32486 nodes in 18 rounds, 0 left retained +[debug/ast-stats] garbage collected 32488 nodes in 18 rounds, 0 left retained [debug/ast-stats] garbage collected 0 nodes in 1 round, 0 left retained diff --git a/tests/Baseline/spicy.types.unit.skip-field/skips.txt b/tests/Baseline/spicy.types.unit.skip-field/skips.txt index 8b8c562ec..01eee0a48 100644 --- a/tests/Baseline/spicy.types.unit.skip-field/skips.txt +++ b/tests/Baseline/spicy.types.unit.skip-field/skips.txt @@ -1,9 +1,9 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. - # Begin parsing production: Skip: a_2 -> skip: a + # Begin parsing production: Skip: a_2 -> skip: a # Begin parsing production: Skip: _anon_6 -> skip: _anon - # Begin parsing production: Skip: c_2 -> skip: c + # Begin parsing production: Skip: c_2 -> skip: c # Begin parsing production: Skip: _anon_2_2 -> skip: _anon_2 # Begin parsing production: Skip: _anon_4_2 -> skip: _anon_4 # Begin parsing production: Skip: _anon_5_2 -> skip: _anon_5 # Begin parsing production: Skip: _anon_7_2 -> skip: _anon_7 - # Begin parsing production: Skip: eod_2 -> skip: eod + # Begin parsing production: Skip: eod_2 -> skip: eod diff --git a/tests/Baseline/spicy.types.unit.sub-unit/.stderr b/tests/Baseline/spicy.types.unit.sub-unit/.stderr index 5d08a342e..d31eef1e9 100644 --- a/tests/Baseline/spicy.types.unit.sub-unit/.stderr +++ b/tests/Baseline/spicy.types.unit.sub-unit/.stderr @@ -1,21 +1,21 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -[debug/ast-stats] garbage collected 1060 nodes in 12 rounds, 7718 left retained -[debug/ast-stats] garbage collected 282 nodes in 11 rounds, 8781 left retained -[debug/ast-stats] garbage collected 70 nodes in 2 rounds, 9137 left retained -[debug/ast-stats] garbage collected 70 nodes in 2 rounds, 9137 left retained +[debug/ast-stats] garbage collected 1068 nodes in 12 rounds, 7716 left retained +[debug/ast-stats] garbage collected 282 nodes in 11 rounds, 8779 left retained +[debug/ast-stats] garbage collected 70 nodes in 2 rounds, 9133 left retained +[debug/ast-stats] garbage collected 70 nodes in 2 rounds, 9133 left retained [debug/ast-stats] # [Spicy] AST statistics: [debug/ast-stats] - # AST rounds 4 [debug/ast-stats] - max tree depth: 16 [debug/ast-stats] - # context declarations: 60 [debug/ast-stats] - # context types: 43 [debug/ast-stats] - # context modules: 4 -[debug/ast-stats] - # nodes reachable in AST: 2699 -[debug/ast-stats] - # nodes live: 9137 -[debug/ast-stats] - # nodes retained: 9137 +[debug/ast-stats] - # nodes reachable in AST: 2697 +[debug/ast-stats] - # nodes live: 9133 +[debug/ast-stats] - # nodes retained: 9133 [debug/ast-stats] - # nodes live > 1%: [debug/ast-stats] - Attribute: 162 [debug/ast-stats] - AttributeSet: 304 -[debug/ast-stats] - QualifiedType: 3089 +[debug/ast-stats] - QualifiedType: 3087 [debug/ast-stats] - ctor::String: 110 [debug/ast-stats] - declaration::Parameter: 127 [debug/ast-stats] - expression::Ctor: 194 @@ -31,24 +31,24 @@ [debug/ast-stats] - type::bytes::Iterator: 144 [debug/ast-stats] - type::operand_list::Operand: 1224 [debug/ast-stats] - type::stream::Iterator: 133 -[debug/ast-stats] garbage collected 5080 nodes in 12 rounds, 17512 left retained -[debug/ast-stats] garbage collected 2884 nodes in 16 rounds, 20338 left retained -[debug/ast-stats] garbage collected 1582 nodes in 8 rounds, 21235 left retained -[debug/ast-stats] garbage collected 3397 nodes in 11 rounds, 22028 left retained -[debug/ast-stats] garbage collected 286 nodes in 3 rounds, 22028 left retained +[debug/ast-stats] garbage collected 5080 nodes in 12 rounds, 17511 left retained +[debug/ast-stats] garbage collected 2884 nodes in 16 rounds, 20337 left retained +[debug/ast-stats] garbage collected 1582 nodes in 8 rounds, 21234 left retained +[debug/ast-stats] garbage collected 3397 nodes in 11 rounds, 22027 left retained +[debug/ast-stats] garbage collected 286 nodes in 3 rounds, 22027 left retained [debug/ast-stats] # [HILTI] AST statistics: [debug/ast-stats] - # AST rounds 5 [debug/ast-stats] - max tree depth: 27 [debug/ast-stats] - # context declarations: 189 [debug/ast-stats] - # context types: 49 [debug/ast-stats] - # context modules: 6 -[debug/ast-stats] - # nodes reachable in AST: 14148 -[debug/ast-stats] - # nodes live: 22028 -[debug/ast-stats] - # nodes retained: 22028 +[debug/ast-stats] - # nodes reachable in AST: 14149 +[debug/ast-stats] - # nodes live: 22027 +[debug/ast-stats] - # nodes retained: 22027 [debug/ast-stats] - # nodes live > 1%: [debug/ast-stats] - Attribute: 247 [debug/ast-stats] - AttributeSet: 580 -[debug/ast-stats] - QualifiedType: 7248 +[debug/ast-stats] - QualifiedType: 7246 [debug/ast-stats] - ctor::String: 288 [debug/ast-stats] - declaration::Parameter: 296 [debug/ast-stats] - expression::Ctor: 693 @@ -66,5 +66,5 @@ [debug/ast-stats] - type::stream::Iterator: 755 [debug/ast-stats] - type::stream::View: 409 [debug/ast-stats] - type::tuple::Element: 598 -[debug/ast-stats] garbage collected 23357 nodes in 18 rounds, 0 left retained +[debug/ast-stats] garbage collected 23356 nodes in 18 rounds, 0 left retained [debug/ast-stats] garbage collected 0 nodes in 1 round, 0 left retained diff --git a/tests/spicy/types/regexp/parse-captures-requires.spicy b/tests/spicy/types/regexp/parse-captures-requires.spicy new file mode 100644 index 000000000..1c0c433ab --- /dev/null +++ b/tests/spicy/types/regexp/parse-captures-requires.spicy @@ -0,0 +1,15 @@ +# @TEST-EXEC: printf 'babc' | spicy-driver -d %INPUT >output +# @TEST-EXEC: btest-diff output +# +# @TEST-DOC: Check that we can use capture group from inside attributes + +module Test; + +public type X = unit { + a: /b/; + b: /a(b+)c/ &requires=($1 == self.a) + { + assert($1 == self.a); + print self; + } +};