-void idx::print(const print_context & c, unsigned level) const
-{
- debugmsg("idx print", LOGLEVEL_PRINT);
-
- if (is_of_type(c, print_tree)) {
-
- c.s << std::string(level, ' ') << class_name()
- << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
- << std::endl;
- unsigned delta_indent = static_cast<const print_tree &>(c).delta_indent;
- value.print(c, level + delta_indent);
- dim.print(c, level + delta_indent);
-
- } else {
-
- if (!is_of_type(c, print_latex))
- c.s << ".";
- bool need_parens = !(is_ex_exactly_of_type(value, numeric) || is_ex_of_type(value, symbol));
- if (need_parens)
- c.s << "(";
- value.print(c);
- if (need_parens)
- c.s << ")";
+void idx::print_index(const print_context & c, unsigned level) const
+{
+ bool need_parens = !(is_exactly_a<numeric>(value) || is_a<symbol>(value));
+ if (need_parens)
+ c.s << "(";
+ value.print(c);
+ if (need_parens)
+ c.s << ")";
+ if (c.options & print_options::print_index_dimensions) {
+ c.s << "[";
+ dim.print(c);
+ c.s << "]";