• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/ruby-106/ruby/lib/

Lines Matching +refs:format +refs:spec

20 # Scanf scans an input string or stream according to a <b>format</b>, as
22 # the format and the input. The format is defined in a string, and is
26 # The format may contain <b>conversion specifiers</b>, which tell scanf
32 # The format string may also contain characters other than those in the
34 # format string matches any amount of white space, including none, in
38 # match the specifications in the format string, or when input is
39 # exhausted, or when everything in the format string has been
48 # # String#scanf and IO#scanf take a single argument, the format string
58 # to the beginning of the format string, and yields a new array of
59 # conversions to the block every time the format string is matched
70 # The single argument to scanf is a format string, which generally
88 # Matches a literal `%'. That is, `%%' in the format string matches a
121 # the format.
136 # the star character ('*'), immediately after the leading '%' of a format
253 # scanf for Ruby is essentially a <format string>-to-<regular
257 # format string ("%d%s...") argument. The FormatString object breaks the
258 # format string down into atoms ("%d", "%5f", "blah", etc.), and from
264 # associated with the format "%d" is "([-+]?\d+)", and the handler
521 @specs.replace s.scan(REGEX).map {|spec| FormatSpecifier.new(spec) }
545 @specs.each_with_index do |spec,i|
547 @last_spec_tried = spec
548 @last_match_tried = spec.match(@string_left)
552 accum << spec.conversion
568 # at the boundary where the string matches a format specifier.
578 # and the last attempted spec/string sub-match succeeded:
580 # could the last spec keep matching?
583 # The last attempted spec/string did not match:
585 # are we on the next-to-last spec in the string?
588 # yes: does current spec care about input space?
611 # See Scanf for details on creating a format string.
636 spec = fstr.last_spec_tried
638 if spec.matched
639 if spec.mid_match?
646 break if spec.count_space?
712 # See Scanf for details on creating a format string.
745 # See Scanf for details on creating a format string.
763 # Scans STDIN for data matching +format+. See IO#scanf for details.
765 # See Scanf for details on creating a format string.
768 def scanf(format, &b) #:doc:
769 STDIN.scanf(format ,&b)