Inline readTopicContextState method

This commit is contained in:
James DiGioia
2018-07-12 23:10:07 -04:00
parent e91a02cc49
commit b847d40842

View File

@@ -2118,7 +2118,7 @@ export default class ExpressionParser extends LValParser {
// had before the function was called.
withTopicPermittingContext<T>(callback: () => T): T {
const outerContextTopicState = this.readTopicContextState();
const outerContextTopicState = this.state.topicContextState;
this.state.topicContextState = {
// Enable the use of the primary topic reference.
maxNumOfResolvableTopics: 1,
@@ -2140,7 +2140,7 @@ export default class ExpressionParser extends LValParser {
// had before the function was called.
withTopicForbiddingContext<T>(callback: () => T): T {
const outerContextTopicState = this.readTopicContextState();
const outerContextTopicState = this.state.topicContextState;
this.state.topicContextState = {
// Disable the use of the primary topic reference.
maxNumOfResolvableTopics: 0,
@@ -2154,10 +2154,6 @@ export default class ExpressionParser extends LValParser {
return callbackResult;
}
readTopicContextState(): tt.TopicContextState {
return this.state.topicContextState;
}
// Register the use of a primary topic reference (`#`) within the current
// topic context.
registerTopicReference(): void {