sxp 1.2.2 → 1.2.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: 2eaff02d432cb19a6dae788a85da4a45d44a04f8c6f40c1a89dcef626772452f
4
- data.tar.gz: 7e94286788c0eaaf82652f397166d7f4bbafcb9acc9b192196a87e18188575e3
3
+ metadata.gz: 5b1a5b8305797234a4ad2e3d91d7c106ce7bcd8f06b27a2438b56b69ffec3d98
4
+ data.tar.gz: 55c8844dba6a9513269a0114fcb9f48a099134592a631cb7311fdc79df40655d
5
5
  SHA512:
6
- metadata.gz: b3273851f27be900a67b34281f62dcd9ce9b9e66977a2ee2ed59d156af15ee30ff185b563775cc90b20dec42976a618c57965f2a46a6c22a0a1eb312b78e1877
7
- data.tar.gz: f4009530afca4965902431880d0d967aacf1cb31af08e098c5bfe86ea0504b8b23299cd9fc476d150843e54b1be36ddc9a942911e8c211bdc465f434580b0012
6
+ metadata.gz: 61a0d3918e572bea20841837a50c4e750fb67735e5ebbe11835a3ad3f1025dfa397a61b8d6527964bf759bf874f17ac090b0680b829715f4bae5fd71e73ed7b1
7
+ data.tar.gz: 96049b94fc160bd7be812bbd834a1d2f9a3eae8bbdd37a721c3941654d40034e691c67728e8422e108759341bead22f8eaf1238497e53a4da2c2cd9cec10bcca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
@@ -7,7 +7,7 @@ module SXP; class Reader
7
7
  #
8
8
  # @see https:/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node14.html
9
9
  class CommonLisp < Basic
10
- OPTIONS = {nil: nil, t: true, quote: :quote, function: :function}
10
+ OPTIONS = {nil: false, t: true, quote: :quote, function: :function}
11
11
 
12
12
  DECIMAL = /^[+-]?(\d*)?\.\d*$/
13
13
  INTEGER_BASE_2 = /^[+-]?[01]+$/
@@ -35,7 +35,7 @@ module SXP; class Reader
35
35
  #
36
36
  # @param [IO, StringIO, String] input
37
37
  # @param [Hash{Symbol => Object}] options
38
- # @option options [Object] :nil (nil)
38
+ # @option options [Object] :nil (false)
39
39
  # @option options [Object] :t (true)
40
40
  # @option options [Object] :quote (:quote)
41
41
  # @option options [Object] :function (:function)
@@ -69,6 +69,21 @@ module SXP; class Reader
69
69
  end
70
70
  end
71
71
 
72
+ ##
73
+ # Based on Basic#read_atom, but adds 't' and 'nil' atoms.
74
+ # @return [Object]
75
+ def read_atom
76
+ case buffer = read_literal
77
+ when '.' then buffer.to_sym
78
+ when RATIONAL then Rational($1.to_i, $2.to_i)
79
+ when DECIMAL then Float(buffer) # FIXME?
80
+ when INTEGER then Integer(buffer)
81
+ when /^t$/i then true
82
+ when /^nil$/i then nil
83
+ else buffer.to_sym
84
+ end
85
+ end
86
+
72
87
  ##
73
88
  # @return [Symbol]
74
89
  def read_symbol(delimiter = nil)
@@ -77,7 +92,7 @@ module SXP; class Reader
77
92
  until delimiter === peek_char
78
93
  buffer <<
79
94
  case char = read_char
80
- when ?\\ then read_character
95
+ when ?\\ then read_char
81
96
  else char
82
97
  end
83
98
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sxp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-14 00:00:00.000000000 Z
12
+ date: 2022-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -29,16 +29,16 @@ dependencies:
29
29
  name: matrix
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '0'
34
+ version: '0.4'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0'
41
+ version: '0.4'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: amazing_print
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.3.3
142
+ rubygems_version: 3.3.7
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: A pure-Ruby implementation of a universal S-expression parser.