sxp 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CREDITS ADDED
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -8,6 +8,8 @@ module SXP; class Reader
8
8
  #
9
9
  # @see http://openjena.org/wiki/SSE
10
10
  class SPARQL < Extended
11
+ EXPONENT = /[eE][+-]?[0-9]+/
12
+ DECIMAL = /^[+-]?(\d*)?\.\d*#{EXPONENT}?$/
11
13
  BNODE_ID = /^_:([A-Za-z][A-Za-z0-9]*)/ # FIXME
12
14
  BNODE_NEW = /^_:$/
13
15
  VAR_ID = /^\?([A-Za-z][A-Za-z0-9]*)/ # FIXME
@@ -47,7 +49,7 @@ module SXP; class Reader
47
49
  buffer = String.new
48
50
  skip_char # '<'
49
51
  return :< if (char = peek_char).nil? || char.chr !~ ATOM # FIXME: nasty special case for the '< symbol
50
- return :<= if peek_char.chr.eql?(?=) && read_char # FIXME: nasty special case for the '<= symbol
52
+ return :<= if peek_char.chr.eql?(?=.chr) && read_char # FIXME: nasty special case for the '<= symbol
51
53
  until peek_char == ?>
52
54
  buffer << read_char # TODO: unescaping
53
55
  end
@@ -60,7 +62,7 @@ module SXP; class Reader
60
62
  def read_atom
61
63
  case buffer = read_literal
62
64
  when '.' then buffer.to_sym
63
- when DECIMAL then RDF::Literal(Float(buffer + '0'))
65
+ when DECIMAL then RDF::Literal(Float(buffer[-1].eql?(?.) ? buffer + '0' : buffer))
64
66
  when INTEGER then RDF::Literal(Integer(buffer))
65
67
  when BNODE_ID then RDF::Node($1)
66
68
  when BNODE_NEW then RDF::Node.new
data/lib/sxp/version.rb CHANGED
@@ -2,7 +2,7 @@ module SXP
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 10
5
+ TINY = 11
6
6
  EXTRA = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 10
9
- version: 0.0.10
8
+ - 11
9
+ version: 0.0.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Arto Bendiken
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-30 00:00:00 +02:00
17
+ date: 2010-11-01 00:00:00 +01:00
18
18
  default_executable: sxp2rdf
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -58,6 +58,7 @@ extra_rdoc_files: []
58
58
 
59
59
  files:
60
60
  - AUTHORS
61
+ - CREDITS
61
62
  - README
62
63
  - UNLICENSE
63
64
  - VERSION