Module: CEML::Lexer::Range2

Defined in:
lib/ceml/lang/tt/lexer.rb

Instance Method Summary collapse

Instance Method Details

#valueObject



1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/ceml/lang/tt/lexer.rb', line 1091

def value
  case text_value
  when 'an', 'a', 'one', 'the' then (1..1)
  when 'some', 'all'           then (1..10000)
  when 'several'               then (3..10000)
  when 'many'                  then (5..10000)
  when /^\d+\+$/               then (floor.value..10000)
  when /^\d+\-\d+$/            then (min.value..max.value)
  when /^\d+$/                 then (floor.value..floor.value)
  else raise 'hell'
  end
end