question: 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 ; }
target:  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').