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 +4 -0
- data/Rakefile +7 -0
- data/cast.gemspec +1 -0
- data/lib/cast/c.y +3 -1
- data/lib/cast/version.rb +1 -1
- data/test/c_nodes_test.rb +1 -1
- data/test/lexer_test.rb +1 -1
- data/test/node_list_test.rb +1 -1
- data/test/node_test.rb +1 -1
- data/test/parse_test.rb +10 -1
- data/test/parser_test.rb +1 -1
- data/test/preprocessor_test.rb +1 -1
- data/test/render_test.rb +1 -1
- metadata +25 -11
- data/test/all.rb +0 -5
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/cast.gemspec
CHANGED
@@ -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'
|
data/lib/cast/c.y
CHANGED
@@ -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 {
|
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
|
data/lib/cast/version.rb
CHANGED
data/test/c_nodes_test.rb
CHANGED
data/test/lexer_test.rb
CHANGED
data/test/node_list_test.rb
CHANGED
data/test/node_test.rb
CHANGED
data/test/parse_test.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
######################################################################
|
6
6
|
|
7
|
-
require '
|
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'
|
data/test/parser_test.rb
CHANGED
data/test/preprocessor_test.rb
CHANGED
data/test/render_test.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
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:
|
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:
|
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.
|
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:
|