cast 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.1 2012-12-19
2
+
3
+ * Parse adjacent string literals correctly.
4
+
1
5
  == 0.2.0 2012-05-14
2
6
 
3
7
  * Works with Ruby 1.8.6, 1.8.7, 1.9.2, 1.9.3.
data/Rakefile CHANGED
@@ -1,4 +1,11 @@
1
1
  require 'ritual'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << "test"
6
+ t.test_files = FileList['test/*_test.rb']
7
+ t.verbose = true
8
+ end
2
9
 
3
10
  extension
4
11
 
@@ -6,6 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.version = C::VERSION
7
7
  gem.authors = ["George Ogata"]
8
8
  gem.email = ["george.ogata@gmail.com"]
9
+ gem.license = 'MIT'
9
10
  gem.date = Time.now.strftime('%Y-%m-%d')
10
11
  gem.summary = "C parser and AST constructor."
11
12
  gem.homepage = 'http://github.com/oggy/cast'
@@ -532,8 +532,10 @@ enumeration_constant
532
532
  : ID {result = val[0]}
533
533
 
534
534
  # Returns StringLiteral
535
+ # Also handles string literal concatenation (6.4.5.4)
535
536
  string_literal
536
- : SCON {result = val[0].val; result.pos = val[0].pos}
537
+ : string_literal SCON {val[0].val << val[1].val.val; result = val[0]}
538
+ | SCON { result = val[0].val; result.pos = val[0].pos }
537
539
 
538
540
  ---- inner
539
541
  # A.1.9 -- Preprocessing numbers -- skip
@@ -1,5 +1,5 @@
1
1
  module C
2
- VERSION = [0, 2, 0]
2
+ VERSION = [0, 2, 1]
3
3
 
4
4
  class << VERSION
5
5
  include Comparable
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  class MiscTests < Test::Unit::TestCase
10
10
 
@@ -6,7 +6,7 @@
6
6
  #
7
7
  ######################################################################
8
8
 
9
- require 'test/test_helper'
9
+ require 'test_helper'
10
10
 
11
11
  class LexerTest < Test::Unit::TestCase
12
12
  def check(s)
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  #
10
10
  # NodeListTest classes are abstract, inherited by classes which define
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  Chain = C::NodeChain
10
10
 
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  class MatchTest < Test::Unit::TestCase
10
10
  def setup
@@ -1934,6 +1934,15 @@ EOS
1934
1934
  assert_raise(C::ParseError){C::StringLiteral.parse('return')}
1935
1935
  end
1936
1936
 
1937
+ def test_string_literal_concatenation
1938
+ check C::StringLiteral, <<EOS
1939
+ "hello" " " "world!"
1940
+ ----
1941
+ StringLiteral
1942
+ val: "hello world!"
1943
+ EOS
1944
+ end
1945
+
1937
1946
  def test_char_literal
1938
1947
  check C::CharLiteral, <<EOS
1939
1948
  'x'
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  class ParserTest < Test::Unit::TestCase
10
10
  def check(s)
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  # publicize the private methods so we can test them easily
10
10
  class C::Preprocessor
@@ -4,7 +4,7 @@
4
4
  #
5
5
  ######################################################################
6
6
 
7
- require 'test/test_helper'
7
+ require 'test_helper'
8
8
 
9
9
  class RenderTest < Test::Unit::TestCase
10
10
  def setup
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ritual
16
- requirement: &70254348936800 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 0.4.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70254348936800
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.4.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: racc
27
- requirement: &70254349108160 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: 1.4.8
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70254349108160
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 1.4.8
36
46
  description:
37
47
  email:
38
48
  - george.ogata@gmail.com
@@ -64,7 +74,6 @@ files:
64
74
  - lib/cast/tempfile.rb
65
75
  - lib/cast/to_s.rb
66
76
  - lib/cast/version.rb
67
- - test/all.rb
68
77
  - test/c_nodes_test.rb
69
78
  - test/lexer_test.rb
70
79
  - test/node_list_test.rb
@@ -77,7 +86,8 @@ files:
77
86
  - ext/yylex.c
78
87
  - lib/cast/c.tab.rb
79
88
  homepage: http://github.com/oggy/cast
80
- licenses: []
89
+ licenses:
90
+ - MIT
81
91
  post_install_message:
82
92
  rdoc_options: []
83
93
  require_paths:
@@ -88,20 +98,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
98
  - - ! '>='
89
99
  - !ruby/object:Gem::Version
90
100
  version: '0'
101
+ segments:
102
+ - 0
103
+ hash: 2706144592644454068
91
104
  required_rubygems_version: !ruby/object:Gem::Requirement
92
105
  none: false
93
106
  requirements:
94
107
  - - ! '>='
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0'
110
+ segments:
111
+ - 0
112
+ hash: 2706144592644454068
97
113
  requirements: []
98
114
  rubyforge_project:
99
- rubygems_version: 1.8.10
115
+ rubygems_version: 1.8.24
100
116
  signing_key:
101
117
  specification_version: 3
102
118
  summary: C parser and AST constructor.
103
119
  test_files:
104
- - test/all.rb
105
120
  - test/c_nodes_test.rb
106
121
  - test/lexer_test.rb
107
122
  - test/node_list_test.rb
@@ -111,4 +126,3 @@ test_files:
111
126
  - test/preprocessor_test.rb
112
127
  - test/render_test.rb
113
128
  - test/test_helper.rb
114
- has_rdoc:
@@ -1,5 +0,0 @@
1
- require 'test/test_helper'
2
-
3
- Dir["#{ROOT}/test/**/*_test.rb"].each do |path|
4
- require path
5
- end