Sha256: d9e542d77e3ef323225f08777c0a6bee14d2ee6b88b96d401827274ccc246904

Contents?: true

Size: 376 Bytes

Versions: 3

Compression:

Stored size: 376 Bytes

Contents

module Music
module Transcription
module Parsing

grammar NonnegativeFloat
  rule nonnegative_float
    (float1 / float2) {
      def to_f
        text_value.to_f
      end
      
      alias :to_num :to_f
    }
  end

  rule float1
    [0-9]+ exponent
  end

  rule float2
    [0-9]+ [.] [0-9]+ exponent?
  end
    
  rule exponent
    "e" [+-]? [0-9]+
  end
end

end
end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
music-transcription-0.21.0 lib/music-transcription/parsing/numbers/nonnegative_float_parsing.treetop
music-transcription-0.20.0 lib/music-transcription/parsing/numbers/nonnegative_float_parsing.treetop
music-transcription-0.19.0 lib/music-transcription/parsing/numbers/nonnegative_float_parsing.treetop