diff options
author | Morgan Deters <mdeters@cs.nyu.edu> | 2013-02-07 15:28:20 -0500 |
---|---|---|
committer | Morgan Deters <mdeters@cs.nyu.edu> | 2013-02-07 15:28:20 -0500 |
commit | c6c20b80eb836a3b44f15835f91d6d1d7af342df (patch) | |
tree | 6f4667a4cac4f80271d0d2e7b0b9bb91f1eef969 /src/expr/expr_template.h | |
parent | 98eec3152a2b24dc0cc04cd1ea595e400cca203e (diff) |
Make --default-dag-thresh apply to stringstreams
Diffstat (limited to 'src/expr/expr_template.h')
-rw-r--r-- | src/expr/expr_template.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/expr/expr_template.h b/src/expr/expr_template.h index 442d29ac9..a52bc00ac 100644 --- a/src/expr/expr_template.h +++ b/src/expr/expr_template.h @@ -654,6 +654,11 @@ public: l = options::defaultExprDepth(); } if(l == 0) { + // if called from outside the library, we may not have options + // available to us at this point (or perhaps the output language + // is not set in Options). Default to something reasonable, but + // don't set "l" since that would make it "sticky" for this + // stream. return s_defaultPrintDepth; } } @@ -797,7 +802,17 @@ public: if(l == 0) { // set the default dag setting on this ostream // (offset by one to detect whether default has been set yet) - l = s_defaultDag + 1; + if(&Options::current() != NULL) { + l = options::defaultDagThresh() + 1; + } + if(l == 0) { + // if called from outside the library, we may not have options + // available to us at this point (or perhaps the output language + // is not set in Options). Default to something reasonable, but + // don't set "l" since that would make it "sticky" for this + // stream. + return s_defaultDag + 1; + } } return static_cast<size_t>(l - 1); } |