mucgly 0.1.1 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +5 -0
- data/README.rdoc +49 -4
- data/bin/mucgly +1 -1
- data/doc/Mucgly.html +2 -2
- data/doc/_index.html +1 -1
- data/doc/file.CHANGELOG.html +6 -2
- data/doc/file.README.html +55 -5
- data/doc/index.html +55 -5
- data/doc/top-level-namespace.html +1 -1
- data/ext/mucgly/mucgly.c +785 -288
- data/lib/version.rb +1 -1
- data/test/doit +5 -0
- data/test/golden/test_block.txt +4 -0
- data/test/golden/test_multihook.txt +4 -0
- data/test/golden/test_multihook_cli.txt +4 -0
- data/test/result/test_block.txt +4 -0
- data/test/result/test_multihook.txt +4 -0
- data/test/result/test_multihook_cli.txt +4 -0
- data/test/test_block.rx.txt +11 -0
- data/test/test_mucgly.rb +11 -4
- data/test/test_multihook.rx.c +17 -0
- data/test/test_multihook_cli.rx.c +16 -0
- metadata +22 -2
data/lib/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
The blocked lines will not be visible in the output.
|
2
|
+
This is the last line visible before block.
|
3
|
+
-<:block>-\
|
4
|
+
Blocked line1.
|
5
|
+
Blocked line2.
|
6
|
+
Blocked line3.
|
7
|
+
Blocked line4.
|
8
|
+
Blocked line5.
|
9
|
+
-<:unblock>-\
|
10
|
+
This is the first line after block.
|
11
|
+
Last line...
|
data/test/test_mucgly.rb
CHANGED
@@ -3,13 +3,14 @@ require 'test/unit'
|
|
3
3
|
|
4
4
|
|
5
5
|
# Test execution routine.
|
6
|
-
def runTest( cmdopts, test, sep = "" )
|
7
|
-
rf = "result/#{test}
|
8
|
-
gf = "golden/#{test}
|
6
|
+
def runTest( cmdopts, test, sep = ".rx.txt" )
|
7
|
+
rf = "result/#{test}.txt"
|
8
|
+
gf = "golden/#{test}.txt"
|
9
9
|
|
10
|
-
system( "export RUBYLIB=../lib; ../bin/mucgly -i -m #{cmdopts} -f #{test}
|
10
|
+
system( "export RUBYLIB=../lib; ../bin/mucgly -i -m #{cmdopts} -f #{test}#{sep} -o #{rf}" )
|
11
11
|
|
12
12
|
if false
|
13
|
+
# if true
|
13
14
|
# Populate golden files after inspection.
|
14
15
|
system( "cp #{rf} #{gf}" )
|
15
16
|
end
|
@@ -44,4 +45,10 @@ class MucglyTest < Test::Unit::TestCase
|
|
44
45
|
assert( system( "diff #{rf2} #{gf2}" ), "FAILED: diff #{rf2} #{gf2}" )
|
45
46
|
end
|
46
47
|
|
48
|
+
def test_block() runTest( "", "test_block" ); end
|
49
|
+
|
50
|
+
def test_multihook() runTest( "", "test_multihook", ".rx.c" ); end
|
51
|
+
|
52
|
+
def test_multihook_cli() runTest( "-u '/*..' -u '..*/' -u '_L/*' -u '_J*/'", "test_multihook_cli", ".rx.c" ); end
|
53
|
+
|
47
54
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
-<+Mucgly.multihook( [ "/*..", "..*/", "_L/*", "_J*/" ] )>-
|
2
|
+
/*..+@name="hookpair"..*/
|
3
|
+
/*..+/Use the non-valid hookend within next macro for testing
|
4
|
+
that is does not cause panic..*/
|
5
|
+
typedef struct _L/*Mucgly.write(@name); %Q{..*/} _J*/_s {
|
6
|
+
gchar* beg; /**< Hookbeg for input file. */
|
7
|
+
gchar* end; /**< Hookend for input file. */
|
8
|
+
} hookpair_t;
|
9
|
+
/*..+:block..*/
|
10
|
+
|
11
|
+
//_J*/
|
12
|
+
|
13
|
+
typedef struct filestack_s {
|
14
|
+
GList* file; /**< Stack of files. */
|
15
|
+
} filestack_t;
|
16
|
+
/*..+:unblock..*/
|
17
|
+
/*..+:block..*/
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*..+@name="hookpair"..*/
|
2
|
+
/*..+/Use the non-valid hookend within next macro for testing
|
3
|
+
that is does not cause panic..*/
|
4
|
+
typedef struct _L/*Mucgly.write(@name); %Q{..*/} _J*/_s {
|
5
|
+
gchar* beg; /**< Hookbeg for input file. */
|
6
|
+
gchar* end; /**< Hookend for input file. */
|
7
|
+
} hookpair_t;
|
8
|
+
/*..+:block..*/
|
9
|
+
|
10
|
+
//_J*/
|
11
|
+
|
12
|
+
typedef struct filestack_s {
|
13
|
+
GList* file; /**< Stack of files. */
|
14
|
+
} filestack_t;
|
15
|
+
/*..+:unblock..*/
|
16
|
+
/*..+:block..*/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mucgly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tero Isannainen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Mucgly is a macro expander for inline macros that exist in the middle
|
@@ -46,22 +46,32 @@ files:
|
|
46
46
|
- ext/mucgly/extconf.rb
|
47
47
|
- ext/mucgly/mucgly.c
|
48
48
|
- lib/version.rb
|
49
|
+
- test/doit
|
49
50
|
- test/golden/test_basic.txt
|
51
|
+
- test/golden/test_block.txt
|
50
52
|
- test/golden/test_file_ctrl.txt
|
53
|
+
- test/golden/test_multihook.txt
|
54
|
+
- test/golden/test_multihook_cli.txt
|
51
55
|
- test/golden/test_redirect.txt
|
52
56
|
- test/golden/test_specials_cli.txt
|
53
57
|
- test/golden/test_specials_cmd.txt
|
54
58
|
- test/result/test_basic.txt
|
59
|
+
- test/result/test_block.txt
|
55
60
|
- test/result/test_file_ctrl.txt
|
61
|
+
- test/result/test_multihook.txt
|
62
|
+
- test/result/test_multihook_cli.txt
|
56
63
|
- test/result/test_redirect.txt
|
57
64
|
- test/result/test_specials_cli.txt
|
58
65
|
- test/result/test_specials_cmd.txt
|
59
66
|
- test/result/test_specials_cmd2.txt
|
60
67
|
- test/test_basic.rx.txt
|
68
|
+
- test/test_block.rx.txt
|
61
69
|
- test/test_file_ctrl.rx.txt
|
62
70
|
- test/test_include.rb
|
63
71
|
- test/test_include.txt
|
64
72
|
- test/test_mucgly.rb
|
73
|
+
- test/test_multihook.rx.c
|
74
|
+
- test/test_multihook_cli.rx.c
|
65
75
|
- test/test_skip.txt
|
66
76
|
- test/test_specials_cli.rx.txt
|
67
77
|
- test/test_specials_cmd.rx.txt
|
@@ -91,11 +101,18 @@ specification_version: 4
|
|
91
101
|
summary: Mucgly processes inline macros.
|
92
102
|
test_files:
|
93
103
|
- test/test_skip.txt
|
104
|
+
- test/golden/test_block.txt
|
94
105
|
- test/golden/test_basic.txt
|
95
106
|
- test/golden/test_specials_cli.txt
|
107
|
+
- test/golden/test_multihook_cli.txt
|
96
108
|
- test/golden/test_file_ctrl.txt
|
109
|
+
- test/golden/test_multihook.txt
|
97
110
|
- test/golden/test_redirect.txt
|
98
111
|
- test/golden/test_specials_cmd.txt
|
112
|
+
- test/test_multihook_cli.rx.c
|
113
|
+
- test/doit
|
114
|
+
- test/test_multihook.rx.c
|
115
|
+
- test/test_block.rx.txt
|
99
116
|
- test/test_specials_cmd.rx.txt
|
100
117
|
- test/test_include.rb
|
101
118
|
- test/test_include.txt
|
@@ -103,9 +120,12 @@ test_files:
|
|
103
120
|
- test/test_specials_cli.rx.txt
|
104
121
|
- test/test_mucgly.rb
|
105
122
|
- test/test_file_ctrl.rx.txt
|
123
|
+
- test/result/test_block.txt
|
106
124
|
- test/result/test_basic.txt
|
107
125
|
- test/result/test_specials_cli.txt
|
126
|
+
- test/result/test_multihook_cli.txt
|
108
127
|
- test/result/test_file_ctrl.txt
|
128
|
+
- test/result/test_multihook.txt
|
109
129
|
- test/result/test_specials_cmd2.txt
|
110
130
|
- test/result/test_redirect.txt
|
111
131
|
- test/result/test_specials_cmd.txt
|