minihtml 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3344f1746e177e0685a421dca8e443dd0d2c3770d0b8188a3d9eb77fbab8a798
4
- data.tar.gz: fb0ed43e289e84449ef1636cc38f40e8f250884bec09188d66918fd8150a2500
3
+ metadata.gz: 3d90a28350da95008be85c99ce550b4d12639ab4f4976118399f4c38ac805caf
4
+ data.tar.gz: 537eb44bc01696dcc6dc7021dbb0a195c4b345ac2c664639a2ec7df63707c706
5
5
  SHA512:
6
- metadata.gz: 6376d8f7355ccfd408803f11f092915c75ac49849439aafc7e952e386dbbcd3c42f2456295b0bf7a431bfa05ec5f728eef2d079cdfa7ebe4297feda66f2a3fc2
7
- data.tar.gz: 96912dc65721e26e920a3a1679aa154f0b8c82814f923e933b4eb71c47fb3198ff90bc7459b1fe85b4a197695be36563afb99c698f29af55c494ae7435b45de7
6
+ metadata.gz: 8183a4e0de66c425138fab1726aa1c8f79fc9718373eab03c77325f83458d2575a6635fb23c6c5e390f7f1492eafd8ebefa3d1a95b935477c243e188c2c9a77f
7
+ data.tar.gz: 4e99ac58f94d4c7cc50c483139d726ce1dd488110d826eebefd173a23d79bcc3e81bf46e681976b5ddf5964873c6b9959e5203390fd5dbca6d712a8b57f697df
@@ -294,6 +294,15 @@ static void scanner_consume_attr_name(scanner_t *t) {
294
294
  }
295
295
  }
296
296
 
297
+ static void scanner_consume_unquoted_attr_value(scanner_t *t) {
298
+ bool consumed = false;
299
+ while (t->look[0] != EOF && !scanner_is_space(t->look[0]) && t->look[0] != SOLIDUS && t->look[0] != ANGLED_RIGHT) {
300
+ scanner_consume(t);
301
+ consumed = true;
302
+ }
303
+ if (consumed) scanner_push_token_simple(t, sym_attr_value_unquoted);
304
+ }
305
+
297
306
  static void scanner_consume_attr(scanner_t *t) {
298
307
  scanner_start_token(t);
299
308
  scanner_consume_attr_name(t);
@@ -316,8 +325,7 @@ static void scanner_consume_attr(scanner_t *t) {
316
325
  }
317
326
  default:
318
327
  scanner_start_token(t);
319
- scanner_consume_tag_ident(t);
320
- scanner_push_token_simple(t, sym_attr_value_literal);
328
+ scanner_consume_unquoted_attr_value(t);
321
329
  break;
322
330
  }
323
331
  }
@@ -529,7 +537,6 @@ RUBY_FUNC_EXPORTED void Init_minihtml_scanner(void) {
529
537
  INITIALIZE_REUSABLE_SYMBOL(tag_closing_end);
530
538
  INITIALIZE_REUSABLE_SYMBOL(right_angled);
531
539
  INITIALIZE_REUSABLE_SYMBOL(attr_key);
532
- INITIALIZE_REUSABLE_SYMBOL(attr_value_literal);
533
540
  INITIALIZE_REUSABLE_SYMBOL(kind);
534
541
  INITIALIZE_REUSABLE_SYMBOL(string);
535
542
  INITIALIZE_REUSABLE_SYMBOL(string_interpolation);
@@ -538,6 +545,7 @@ RUBY_FUNC_EXPORTED void Init_minihtml_scanner(void) {
538
545
  INITIALIZE_REUSABLE_SYMBOL(equal);
539
546
  INITIALIZE_REUSABLE_SYMBOL(quote_char);
540
547
  INITIALIZE_REUSABLE_SYMBOL(tag_comment_end);
548
+ INITIALIZE_REUSABLE_SYMBOL(attr_value_unquoted);
541
549
 
542
550
  rb_define_alloc_func(rb_cScanner, scanner_alloc);
543
551
  rb_define_method(rb_cScanner, "initialize", scanner_initialize, 1);
@@ -45,7 +45,6 @@ DEFINE_REUSABLE_SYMBOL(tag_closing_start);
45
45
  DEFINE_REUSABLE_SYMBOL(tag_closing_end);
46
46
  DEFINE_REUSABLE_SYMBOL(right_angled);
47
47
  DEFINE_REUSABLE_SYMBOL(attr_key);
48
- DEFINE_REUSABLE_SYMBOL(attr_value_literal);
49
48
  DEFINE_REUSABLE_SYMBOL(kind);
50
49
  DEFINE_REUSABLE_SYMBOL(string);
51
50
  DEFINE_REUSABLE_SYMBOL(string_interpolation);
@@ -54,6 +53,7 @@ DEFINE_REUSABLE_SYMBOL(executable);
54
53
  DEFINE_REUSABLE_SYMBOL(equal);
55
54
  DEFINE_REUSABLE_SYMBOL(quote_char);
56
55
  DEFINE_REUSABLE_SYMBOL(tag_comment_end);
56
+ DEFINE_REUSABLE_SYMBOL(attr_value_unquoted);
57
57
 
58
58
  typedef struct {
59
59
  VALUE str;
@@ -28,7 +28,7 @@ module MiniHTML
28
28
  else
29
29
  parse_tag
30
30
  end
31
- when :attr_value_literal
31
+ when :attr_value_unquoted
32
32
  AST::Literal.new(stream.consume)
33
33
  when :string
34
34
  AST::String.new(stream.consume)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniHTML
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minihtml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vito Sartori