zotica 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abf224bc0d1fbdb888f065696a6ae147d51aa015a1de4b30dd5b68da1c66098c
4
- data.tar.gz: d53b42428e061719d32fd63e0be9d6f47ac528649d36de2444e4b4a650f51d2c
3
+ metadata.gz: cf856113458672fe1b16b7a882da99623e3b4bbe2d2fd7c8ddced1067959f321
4
+ data.tar.gz: bbbda892621bda4fd6b09bc428d3717d42dcff4d86937ae9864c91ded6b6423a
5
5
  SHA512:
6
- metadata.gz: f59be65b74729aff605a4a8f3e30d6d75bd6e97b96ccfa428492c87617325bc15ec1bc62f2450d4c37a1876fd96bc6e70441bcff83b87054772168e04c40da6a
7
- data.tar.gz: 2d7de037552bab343a12b4c7cf73c5f23384d8d53c8b14ac246b538fd08b79d689340e1841365611f3347c97c3557e5d1a1c48215c921a75e1214043ba465843
6
+ metadata.gz: 8ddb1692a5a1d5e596f0064a0dd6a11f7c233eb3929448f03931ea746f54c81e0a05a6f4e4d1af43fde3edfbab75e67686c491fc75e08b5f0ac4642f50feaad5
7
+ data.tar.gz: be8380c9230fa235375096c0f249c5ede3cc7a5e78e210e7e8aad35ed227666379c625939fb6106e2c485bd004b91f2457c9c634e2de023173b35af9ed0740ee
data/source/zotica.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Zenithal
5
5
 
6
- ZOTICA_VERSION = "1.1.0"
6
+ ZOTICA_VERSION = "1.2.0"
7
7
  ZOTICA_VERSION_ARRAY = ZOTICA_VERSION.split(/\./).map(&:to_i)
8
8
 
9
9
  end
@@ -6,6 +6,8 @@ module Zenithal::ZoticaSingleParserMethod
6
6
  SPACE_ALTERNATIVES = {"sfun" => "afun", "sbin" => "abin", "srel" => "arel", "ssbin" => "asbin", "ssrel" => "asrel", "scas" => "acas", "quad" => "sgl", "qquad" => "dbl"}
7
7
  PHANTOM_TYPES = {"ph" => "bth", "vph" => "ver", "hph" => "hor"}
8
8
 
9
+ private
10
+
9
11
  def parse
10
12
  if @block
11
13
  inner_element = parse_math_root
@@ -17,8 +19,6 @@ module Zenithal::ZoticaSingleParserMethod
17
19
  return nodes
18
20
  end
19
21
 
20
- private
21
-
22
22
  def create_math_element(name, attributes, children_list, options = {})
23
23
  this = REXML::Nodes[]
24
24
  options[:role] = determine_role(attributes)
@@ -461,41 +461,29 @@ class Zenithal::ZoticaParser < Zenithal::ZenithalParser
461
461
 
462
462
  def initialize(source)
463
463
  super(source)
464
- @raw_macro_names = []
465
- @math_macros = {}
466
- @fonts = {}
464
+ @inner_parser = Zenithal::ZoticaSingleParser.new(source)
467
465
  end
468
466
 
469
467
  def load_font(path)
470
- if path
471
- @fonts[:main] = JSON.parse(File.read(path))
472
- end
468
+ @inner_parser.load_font(path)
473
469
  end
474
470
 
475
471
  def register_math_macro(name, &block)
476
472
  outer_self = self
477
473
  register_plugin(name) do |attributes|
478
- parser = Zenithal::ZoticaSingleParser.new(@source)
479
- @raw_macro_names.each do |raw_macro_name|
480
- parser.register_plugin(raw_macro_name) do |_|
481
- raw_parser = outer_self.clone
482
- raw_parser.exact = false
483
- raw_parser.whole = false
484
- next raw_parser
485
- end
486
- end
487
- @math_macros.each do |math_macro_name, math_macro_block|
488
- parser.register_plugin(math_macro_name) do |_|
489
- math_parser = parser.clone
490
- math_parser.setup(attributes, math_macro_block)
491
- next math_parser
492
- end
493
- end
474
+ parser = @inner_parser.clone
475
+ parser.version = outer_self.instance_variable_get("@version")
476
+ parser.update(@source)
477
+ parser.setup(attributes, block)
478
+ next parser
479
+ end
480
+ @inner_parser.register_plugin(name) do |attributes|
481
+ parser = @inner_parser.clone
482
+ parser.version = outer_self.instance_variable_get("@version")
483
+ parser.update(@source)
494
484
  parser.setup(attributes, block)
495
- parser.fonts = @fonts
496
485
  next parser
497
486
  end
498
- @math_macros[name] = block
499
487
  end
500
488
 
501
489
  def register_simple_math_macro(name)
@@ -510,7 +498,13 @@ class Zenithal::ZoticaParser < Zenithal::ZenithalParser
510
498
  end
511
499
 
512
500
  def register_raw_macro(name)
513
- @raw_macro_names << name
501
+ outer_self = self
502
+ @inner_parser.register_plugin(name) do |_|
503
+ raw_parser = outer_self.clone
504
+ raw_parser.exact = false
505
+ raw_parser.whole = false
506
+ next raw_parser
507
+ end
514
508
  end
515
509
 
516
510
  def raw_macro_name=(name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zotica
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziphil
8
8
  autorequire:
9
9
  bindir: exec
10
10
  cert_chain: []
11
- date: 2020-04-16 00:00:00.000000000 Z
11
+ date: 2020-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zenml
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.3.0
22
+ version: 1.6.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.3.0
32
+ version: 1.6.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sassc
35
35
  requirement: !ruby/object:Gem::Requirement