get ast() {
    if (this.internalAST !== undefined) {
      return this.internalAST;
    }

    if (_.isString(this.source)) {
      try {
        this.internalAST = new Ast(this.source);
      } catch (err) {
        this.internalAST = null;

        let message = 'YAML Syntax Error';
        if (err.problem) {
          message = `${message}: ${err.problem}`;
        }

        const annotation = this.createAnnotation(annotations.AST_UNAVAILABLE, null, message);

        if (err.problem_mark && err.problem_mark.pointer) {
          const SourceMap = this.namespace.getElementClass('sourceMap');
          const position = err.problem_mark.pointer;

          annotation.attributes.set('sourceMap', [
            new SourceMap([[position, 1]]),
          ]);
        }
      }
    } else {
      this.internalAST = null;
      this.createAnnotation(
        annotations.AST_UNAVAILABLE, null,
        'Source maps are only available with string input'
      );
    }

    return this.internalAST;
  }
// loaded, then an annotation is generated with more information about why.
loaded, then an annotation is generated with more information about why.
loaded then an annotation is generated with more information about why .
get ast() {
    if (this.internalAST !== undefined) {
      return this.internalAST;
    }
    if (_.isString(this.source)) {
      try {
        this.internalAST = new Ast(this.source);
      } catch (err) {
        this.internalAST = null;
        let message = 'YAML Syntax Error';
        if (err.problem) {
          message = `${message}: ${err.problem}`;
        }
        const annotation = this.createAnnotation(annotations.AST_UNAVAILABLE, null, message);
        if (err.problem_mark && err.problem_mark.pointer) {
          const SourceMap = this.namespace.getElementClass('sourceMap');
          const position = err.problem_mark.pointer;
          annotation.attributes.set('sourceMap', [
            new SourceMap([[position, 1]]),
          ]);
        }
      }
    } else {
      this.internalAST = null;
      this.createAnnotation(
        annotations.AST_UNAVAILABLE, null,
        'Source maps are only available with string input'
      );
    }
    return this.internalAST;
  }
get ast ( ) { if ( this . internalAST !== undefined ) { return this . internalAST ; } if ( _ . isString ( this . source ) ) { try { this . internalAST = new Ast ( this . source ) ; } catch ( err ) { this . internalAST = null ; let message = 'YAML Syntax Error' ; if ( err . problem ) { message = ` ${ message } ${ err . problem } ` ; } const annotation = this . createAnnotation ( annotations . AST_UNAVAILABLE , null , message ) ; if ( err . problem_mark && err . problem_mark . pointer ) { const SourceMap = this . namespace . getElementClass ( 'sourceMap' ) ; const position = err . problem_mark . pointer ; annotation . attributes . set ( 'sourceMap' , [ new SourceMap ( [ [ position , 1 ] ] ) , ] ) ; } } } else { this . internalAST = null ; this . createAnnotation ( annotations . AST_UNAVAILABLE , null , 'Source maps are only available with string input' ) ; } return this . internalAST ; }
loaded, then an annotation is generated with more information about why.
loaded then an annotation is generated with more information about why .