aboutsummaryrefslogtreecommitdiff
path: root/src/boot/bemol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/bemol.cc')
-rw-r--r--src/boot/bemol.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/boot/bemol.cc b/src/boot/bemol.cc
index 0399bb44..bff97039 100644
--- a/src/boot/bemol.cc
+++ b/src/boot/bemol.cc
@@ -74,6 +74,20 @@ struct Fragment : std::vector<Line> {
ColumnIndex last_indent() const {
return empty() ? 0 : back().indent;
}
+ using std::vector<Line>::operator[];
+ const Line& operator()(const OpenAxiom::FragmentCursor& pos) const {
+ return (*this)[pos.line];
+ }
+ uint8_t operator[](const OpenAxiom::FragmentCursor& pos) const {
+ return (*this)[pos.line][pos.column];
+ }
+ uint8_t advance(OpenAxiom::FragmentCursor& pos) const {
+ return (*this)[pos.line][pos.column++];
+ }
+
+ bool covering(const OpenAxiom::FragmentCursor& pos) const {
+ return pos.column < (*this)[pos.line].size();
+ }
};
// Formatting program fragments.