private Integer scanYamlDirectiveNumber(Mark startMark){
  char ch=reader.peek();
  if (!Character.isDigit(ch)) {
    throw new ScannerException("while scanning a directive",startMark,"expected a digit, but found " + ch + "("+ ((int)ch)+ ")",reader.getMark());
  }
  int length=0;
  while (Character.isDigit(reader.peek(length))) {
    length++;
  }
  Integer value=Integer.parseInt(reader.prefixForward(length));
  return value;
}

private Integer scanYamlDirectiveNumber ( Mark startMark ) { char ch = reader . peek ( ) ; if ( ! Character . isDigit ( ch ) ) { throw new ScannerException ( "while scanning a directive" , startMark , "expected a digit, but found " + ch + "(" + ( ( int ) ch ) + ")" , reader . getMark ( ) ) ; } int length = 0 ; while ( Character . isDigit ( reader . peek ( length ) ) ) { length ++ ; } Integer value = Integer . parseInt ( reader . prefixForward ( length ) ) ; return value ; }
read a % yaml directive number : this is either the major or the minor part . stop reading at a non - digit character ( usually either ' . ' or ' \ n ' ) .
