- return entry1.is_math == entry2.is_math
- && (entry1.is_math
- ? (entry1.math.id == entry2.math.id
- && entry1.math.cell == entry2.math.cell)
- : (entry1.text.id == entry2.text.id
- && entry1.text.pos == entry2.text.pos));
+ RowEntry entry;
+ entry.type = begin_document;
+ entry.begindocument = {};
+ return entry;
+}
+
+
+bool operator==(TexRow::RowEntry entry1, TexRow::RowEntry entry2)
+{
+ if (entry1.type != entry2.type)
+ return false;
+ switch (entry1.type) {
+ case TexRow::text_entry:
+ return entry1.text.id == entry2.text.id
+ && entry1.text.pos == entry2.text.pos;
+ case TexRow::math_entry:
+ return entry1.math.id == entry2.math.id
+ && entry1.math.cell == entry2.math.cell;
+ case TexRow::begin_document:
+ return true;
+ default:
+ return false;
+ }