kalculator 0.6.2 → 0.6.3

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
  SHA256:
3
- metadata.gz: bd0089994743a43b5b8ad0b502bfc53758e08ed86f43f521f7e3df5c2d3d6508
4
- data.tar.gz: 2946da73cce1290a9be9fd632af0bfc47b617838e847450196cf869e6d7b6e0e
3
+ metadata.gz: cdb02709346e7a946c7e7149213895a4fa44d4184600c11576925cf344047c4f
4
+ data.tar.gz: a86e405f4af81894477182f841e0036a6b69350e677dfdda5d7828c03044f9fd
5
5
  SHA512:
6
- metadata.gz: 28286114fd1e503f677099ffb567c1ab4eb899f7a4c2ec1d115fe073424a90d527d1f6416e673538a63afb6ed4e81b78e0ec8ae89763441a4f2f2f6fb1b26e8b
7
- data.tar.gz: 12aeacb74451dad37bd06567b92cf4cd585dac83be897325f756a7d74365d297d736a3c06c54643242282ffe55bab455cdcbf6888138effbaaf0403e6ff2a550
6
+ metadata.gz: d8eda4a0a651bfe1861cd74e2ba67e1e6d6fa0da0bd5b404f90f3822d150dafecdb24c259c6f1db3071125dfa594284556c0760a3531f3dd5019dc92c4990ffa
7
+ data.tar.gz: b2a69ca1b2e3865e438d12b2bd8db88157076b843d197d2daec164a4077b6157ac2afefe04802f935e510a50ec4c8251605d9ae19f4c6e6a2482cc26ff10a2d3
@@ -124,6 +124,10 @@ class Kalculator
124
124
  !bool
125
125
  end
126
126
 
127
+ def null(_, _)
128
+ nil
129
+ end
130
+
127
131
  def number(_, number)
128
132
  number
129
133
  end
@@ -16,6 +16,8 @@ class Kalculator
16
16
  rule(/<=/) { :LTE }
17
17
  rule(/==/) { :EQ }
18
18
  rule(/!=/) { :NEQ }
19
+ rule(/and/) { :AND }
20
+ rule(/or/) { :OR }
19
21
  rule(/AND/) { :AND }
20
22
  rule(/OR/) { :OR }
21
23
  rule(/!/) { :BANG }
@@ -35,6 +37,10 @@ class Kalculator
35
37
  rule(/sum/) { |t| :SUM }
36
38
  rule(/true/) { |t| :TRUE }
37
39
  rule(/false/) { |t| :FALSE }
40
+ rule(/null/) { |t| :NULL }
41
+ rule(/TRUE/) { |t| :TRUE }
42
+ rule(/FALSE/) { |t| :FALSE }
43
+ rule(/NULL/) { |t| :NULL }
38
44
  rule(/"[^"]*"/) { |t| [:STRING, t[1..-2]] }
39
45
  rule(/[A-Za-z][A-Za-z0-9\._]*/) { |t| [:IDENT, t] }
40
46
  end
@@ -36,6 +36,7 @@ class Kalculator
36
36
  clause('IDENT') { |n| [:variable, n] }
37
37
  clause('TRUE') { |n| [:boolean, true] }
38
38
  clause('FALSE') { |n| [:boolean, false] }
39
+ clause('NULL') { |n| [:null, nil] }
39
40
 
40
41
  clause('expression GT expression') { |e0, _, e1| [:>, e0, e1] }
41
42
  clause('expression GTE expression') { |e0, _, e1| [:>=, e0, e1] }
@@ -1,3 +1,3 @@
1
1
  class Kalculator
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Ries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-04 00:00:00.000000000 Z
11
+ date: 2018-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rltk