gonum.org/v1/gonum@v0.14.0/graph/formats/rdf/check_actions.rl (about)

     1  // Copyright ©2020 The Gonum Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  %%{
     6  	machine check;
     7  
     8  	action Return {
     9  		return nil
    10  	}
    11  
    12  	action Error {
    13  		if p < len(data) {
    14  			if r := data[p]; r < unicode.MaxASCII {
    15  				return fmt.Errorf("%w: unexpected rune %q at %d", ErrInvalidTerm, data[p], p)
    16  			} else {
    17  				return fmt.Errorf("%w: unexpected rune %q (\\u%04[2]x) at %d", ErrInvalidTerm, data[p], p)
    18  			}
    19  		}
    20  		return ErrIncompleteTerm
    21  	}
    22  }%%