xrb 0.7.0 → 0.9.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.
@@ -16,7 +16,7 @@
16
16
  delegate.instruction(data.byteslice(instruction_begin...instruction_end))
17
17
  }
18
18
 
19
- action emit_instruction_line {
19
+ action emit_multiline_instruction {
20
20
  delegate.instruction(data.byteslice(instruction_begin...instruction_end), "\n")
21
21
  }
22
22
 
@@ -40,7 +40,36 @@
40
40
  raise ParseError.new("failed to parse expression", buffer, p)
41
41
  }
42
42
 
43
+ action text_begin {
44
+ text_begin = p
45
+
46
+ delimiter_begin = nil
47
+ delimiter_end = nil
48
+ }
49
+
50
+ action text_end {
51
+ text_end = p
52
+ }
53
+
54
+ action text_delimiter_begin {
55
+ delimiter_begin = p
56
+ }
57
+
58
+ action text_delimiter_end {
59
+ delimiter_end = p
60
+ }
61
+
43
62
  action emit_text {
63
+ if delimiter_begin
64
+ text_end = delimiter_begin
65
+
66
+ p = delimiter_begin - 1;
67
+ end
68
+
69
+ delegate.text(data.byteslice(text_begin...text_end))
70
+ }
71
+
72
+ action emit_multiline_text {
44
73
  delegate.text(data.byteslice(ts...te))
45
74
  }
46
75
 
@@ -64,8 +93,13 @@ module XRB
64
93
  pe = eof = data.bytesize
65
94
  stack = []
66
95
 
96
+ ts = te = nil
97
+ act = nil
98
+
67
99
  expression_begin = expression_end = nil
68
100
  instruction_begin = instruction_end = nil
101
+ text_begin = text_end = nil
102
+ delimiter_begin = delimiter_end = nil
69
103
 
70
104
  %% write init;
71
105
  %% write exec;
data/lib/xrb/template.rb CHANGED
@@ -55,11 +55,9 @@ module XRB
55
55
 
56
56
  # Output raw text to the template.
57
57
  def text(text)
58
+ # We have to use an approach which preserves newlines and tabs as raw characters.
58
59
  text = text.gsub("'", "\\\\'")
59
60
  @code << "#{OUT}.raw('#{text}');"
60
-
61
- # This is an interesting approach, but it doens't preserve newlines or tabs as raw characters, so template line numbers don't match up.
62
- # @parts << "#{OUT}<<#{text.dump};"
63
61
  end
64
62
 
65
63
  # Output a ruby expression (or part of).
data/lib/xrb/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2012-2024, by Samuel Williams.
5
5
 
6
6
  module XRB
7
- VERSION = "0.7.0"
7
+ VERSION = "0.9.0"
8
8
  end
data/notes.md ADDED
File without changes
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2024-10-17 00:00:00.000000000 Z
43
+ date: 2024-10-26 00:00:00.000000000 Z
44
44
  dependencies: []
45
45
  description:
46
46
  email:
@@ -57,7 +57,6 @@ files:
57
57
  - ext/extconf.h
58
58
  - ext/extconf.rb
59
59
  - ext/markup.o
60
- - ext/mkmf.log
61
60
  - ext/query.o
62
61
  - ext/tag.o
63
62
  - ext/template.o
@@ -100,6 +99,7 @@ files:
100
99
  - lib/xrb/uri.rb
101
100
  - lib/xrb/version.rb
102
101
  - license.md
102
+ - notes.md
103
103
  - readme.md
104
104
  homepage: https://github.com/ioquatix/xrb
105
105
  licenses:
metadata.gz.sig CHANGED
Binary file
data/ext/mkmf.log DELETED
@@ -1,69 +0,0 @@
1
- have_func: checking for rb_sym2str()... -------------------- yes
2
-
3
- DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.3/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
4
- ld: warning: ignoring duplicate libraries: '-lpthread'
5
- checked program was:
6
- /* begin */
7
- 1: #include "ruby.h"
8
- 2:
9
- 3: int main(int argc, char **argv)
10
- 4: {
11
- 5: return !!argv[argc];
12
- 6: }
13
- /* end */
14
-
15
- DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.3/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
16
- ld: warning: ignoring duplicate libraries: '-lpthread'
17
- checked program was:
18
- /* begin */
19
- 1: #include "ruby.h"
20
- 2:
21
- 3: /*top*/
22
- 4: extern int t(void);
23
- 5: int main(int argc, char **argv)
24
- 6: {
25
- 7: if (argc > 1000000) {
26
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
27
- 9: printf("%d", (*tp)());
28
- 10: }
29
- 11:
30
- 12: return !!argv[argc];
31
- 13: }
32
- 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_sym2str; return !p; }
33
- /* end */
34
-
35
- --------------------
36
-
37
- have_func: checking for rb_str_cat_cstr()... -------------------- yes
38
-
39
- DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.3/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
40
- ld: warning: ignoring duplicate libraries: '-lpthread'
41
- checked program was:
42
- /* begin */
43
- 1: #include "ruby.h"
44
- 2:
45
- 3: /*top*/
46
- 4: extern int t(void);
47
- 5: int main(int argc, char **argv)
48
- 6: {
49
- 7: if (argc > 1000000) {
50
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
51
- 9: printf("%d", (*tp)());
52
- 10: }
53
- 11:
54
- 12: return !!argv[argc];
55
- 13: }
56
- 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_str_cat_cstr; return !p; }
57
- /* end */
58
-
59
- --------------------
60
-
61
- extconf.h is:
62
- /* begin */
63
- 1: #ifndef EXTCONF_H
64
- 2: #define EXTCONF_H
65
- 3: #define HAVE_RB_SYM2STR 1
66
- 4: #define HAVE_RB_STR_CAT_CSTR 1
67
- 5: #endif
68
- /* end */
69
-