• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 13378462461

17 Feb 2025 08:59PM UTC coverage: 58.754% (+0.3%) from 58.475%
13378462461

push

github

web-flow
Add support for sequence and index bindings (#760)

* update grammar

* add ast nodes; ast building

* Rename to unpacking

* semantic analysis

* executor work part 1, unpacking indices

* renamings; implement index binding

* small cleanup

* use multi_index; more tests

* use multi_index only for rest, otherwise list

* initial formatting

* add missing token decoding

* address self-review comments

* formatting tweaks

* add test for var binding in classes

* add StringIterator

* fix spread tests

* add cfgfile iterator; add cfgelem opersubscript; tests

* add iterator for SQLResultSet and SQLRow; tests

* Copy value in take global/local

* Allow any iterable can index rest unpacking
Always use dictionary as rest object in index unpacking

* add docs, core-changes, doc tests

* formatting changes...

* address self-review comments

* update formatter, format all binding test srcs

* address review comments
- unset var scope

* add cfgfile/cfgelem docs

* reformat objref svg

501 of 550 new or added lines in 19 files covered. (91.09%)

14 existing lines in 3 files now uncovered.

42235 of 71885 relevant lines covered (58.75%)

377989.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

63.64
/pol-core/bscript/compiler/ast/VariableBinding.cpp
1
#include "VariableBinding.h"
2

3
#include "bscript/compiler/ast/Expression.h"
4
#include "bscript/compiler/ast/Node.h"
5
#include "bscript/compiler/ast/NodeVisitor.h"
6
#include "bscript/compiler/model/ScopableName.h"
7

8
namespace Pol::Bscript::Compiler
9
{
10
VariableBinding::VariableBinding( const SourceLocation& loc, std::string scope, std::string name,
570✔
11
                                  bool rest )
570✔
12
    : Node( loc ), scoped_name( std::move( scope ), std::move( name ) ), rest( rest ), variable()
570✔
13
{
14
}
570✔
15

16
void VariableBinding::accept( NodeVisitor& visitor )
2,580✔
17
{
18
  visitor.visit_variable_binding( *this );
2,580✔
19
}
2,580✔
20

NEW
21
void VariableBinding::describe_to( std::string& w ) const
×
22
{
NEW
23
  fmt::format_to( std::back_inserter( w ), "variable-binding({}{})", scoped_name.string(),
×
NEW
24
                  rest ? "..." : "" );
×
NEW
25
}
×
26

27
}  // namespace Pol::Bscript::Compiler
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc