...

Source file src/oss.terrastruct.com/d2/d2ast/error.go

Documentation: oss.terrastruct.com/d2/d2ast

     1  package d2ast
     2  
     3  // TODO: Right now this is here to be available in both the Parser and Compiler but
     4  // eventually we should make this a real part of the AST so that autofmt works on
     5  // files with parse errors and semantically it makes more sense.
     6  // Compile would continue to maintain a separate set of errors and then we'd do a
     7  // merge & sort to get the final list of errors for user display.
     8  type Error struct {
     9  	Range   Range  `json:"range"`
    10  	Message string `json:"errmsg"`
    11  }
    12  
    13  func (e Error) Error() string {
    14  	return e.Message
    15  }
    16  

View as plain text