teepee 0.12.6 → 0.12.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80d3b41e120755474c7f5f07bb933f931ea346f5
4
- data.tar.gz: 4509080cb66640a3ca8da2520f500a316bdc2e4b
3
+ metadata.gz: 86c89b8367d7c548ca8489fc0c4d2cbb40487649
4
+ data.tar.gz: 441b9d33fb2f9392c316fd83e03fcf98b66d5e05
5
5
  SHA512:
6
- metadata.gz: 12212ac9b8c23ee02a13861614b4fc51e8eb0c083b9380af8a01a590826381a40353decc127212b6d61a3b38d555c491ba4c881d932d101044572afe40a0a24b
7
- data.tar.gz: d62c4c44f2b2b097b326578818088811c560382f5824acd9b9fd29e1ac7085306b025d45eac7af101009a244d946f35dede5e19ae02ef8f5213c73552bf7816c
6
+ metadata.gz: 092e7de71f78de726505ea2271a4c002a4e8afa4ece2fa7c832f569e792fff9d095063061d4ea661edd2fce929457ee3e7452fc2b745ef32cf450087637f5080
7
+ data.tar.gz: 1784bac371758e09ac7ab0d6f63c668764eb8462d5c69cc4780f27925e9875c9da24f95aa53cec7b125dcc5f11ac409ea15218a8dbf8ed362de127b72c41bd8d
@@ -396,8 +396,14 @@ module Teepee
396
396
  @@commander.unless_operator expressions
397
397
  when "do"
398
398
  @@commander.do_operator expressions
399
+ when "prog1"
400
+ @@commander.prog1_operator expressions
401
+ when "progn"
402
+ @@commander.progn_operator expressions
399
403
  when "cond"
400
404
  @@commander.cond_operator expressions
405
+ when "case"
406
+ @@commander.case_operator expressions
401
407
  else
402
408
  command_error "unknown command #{command.to_html}"
403
409
  end
@@ -317,6 +317,21 @@ module Teepee
317
317
  html_tag :br, nil
318
318
  end
319
319
 
320
+ def case_operator expressions
321
+ value, _, *rest = strip expressions
322
+ if value and not rest.empty?
323
+ def cond_helper value, expressions
324
+ test_value, _, form, *rest = strip expressions
325
+ if equal value, test_value
326
+ form
327
+ elsif not rest.empty?
328
+ cond_helper value, rest
329
+ end
330
+ end
331
+ cond_helper value, rest
332
+ end
333
+ end
334
+
320
335
  def cond_operator expressions
321
336
  conditional, _, form, *rest = strip expressions
322
337
  if true_constant? conditional
@@ -354,13 +369,13 @@ module Teepee
354
369
  Math::E
355
370
  end
356
371
 
357
- def equal *numbers
358
- if numbers.empty?
372
+ def equal *expressions
373
+ if expressions.empty?
359
374
  true_constant
360
- elsif numbers.length == 1
375
+ elsif expressions.length == 1
361
376
  true_constant
362
377
  else
363
- numbers[0] == numbers[1] and equal *numbers.rest
378
+ expressions[0].to_s == expressions[1].to_s and equal *expressions.rest
364
379
  end
365
380
  end
366
381
 
@@ -634,6 +649,14 @@ module Teepee
634
649
  "|"
635
650
  end
636
651
 
652
+ def prog1_operator expressions
653
+ expressions.first
654
+ end
655
+
656
+ def progn_operator expressions
657
+ expressions.last
658
+ end
659
+
637
660
  def radians2degrees radians
638
661
  ensure_numeric(radians * 180.0 / Math::PI)
639
662
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teepee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.6
4
+ version: 0.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Mark Gore