Sha256: f10b9401f936c046000a7f7a4c620bced9631125177c81e548be02351fe3468a

Contents?: true

Size: 264 Bytes

Versions: 3

Compression:

Stored size: 264 Bytes

Contents

grammar Numerals
  rule percentage
    (decimal "%") {
      def to_f
        decimal.to_f / 100
      end
    }
  end

  rule decimal
    sign [0-9]+ '.' [0-9]* {
      def to_f
        text_value.to_f
      end
    }
  end

  rule sign
    ('+'/'-')? 
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
swift-pyrite-0.1.1 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/numerals.tt
swift-pyrite-0.1.0 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/numerals.tt
treetop-1.6.3 examples/numerals.tt