Remove hb-ot-shape-complex-machine-index.hh file
Inline code into USE header.
This commit is contained in:
parent
9dd61c5b78
commit
8af85c4e86
|
@ -118,7 +118,6 @@ HB_BASE_sources = \
|
||||||
hb-ot-shape-complex-indic.hh \
|
hb-ot-shape-complex-indic.hh \
|
||||||
hb-ot-shape-complex-khmer.cc \
|
hb-ot-shape-complex-khmer.cc \
|
||||||
hb-ot-shape-complex-khmer.hh \
|
hb-ot-shape-complex-khmer.hh \
|
||||||
hb-ot-shape-complex-machine-index.hh \
|
|
||||||
hb-ot-shape-complex-myanmar.cc \
|
hb-ot-shape-complex-myanmar.cc \
|
||||||
hb-ot-shape-complex-myanmar.hh \
|
hb-ot-shape-complex-myanmar.hh \
|
||||||
hb-ot-shape-complex-thai.cc \
|
hb-ot-shape-complex-thai.cc \
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright © 2019,2020 David Corbett
|
|
||||||
*
|
|
||||||
* This is part of HarfBuzz, a text shaping library.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, without written agreement and without
|
|
||||||
* license or royalty fees, to use, copy, modify, and distribute this
|
|
||||||
* software and its documentation for any purpose, provided that the
|
|
||||||
* above copyright notice and the following two paragraphs appear in
|
|
||||||
* all copies of this software.
|
|
||||||
*
|
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
|
||||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
|
||||||
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
* DAMAGE.
|
|
||||||
*
|
|
||||||
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
|
||||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
|
||||||
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
|
||||||
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HB_OT_SHAPE_COMPLEX_MACHINE_INDEX_HH
|
|
||||||
#define HB_OT_SHAPE_COMPLEX_MACHINE_INDEX_HH
|
|
||||||
|
|
||||||
#include "hb.hh"
|
|
||||||
|
|
||||||
|
|
||||||
template <typename Iter>
|
|
||||||
struct machine_index_t :
|
|
||||||
hb_iter_with_fallback_t<machine_index_t<Iter>,
|
|
||||||
typename Iter::item_t>
|
|
||||||
{
|
|
||||||
machine_index_t (const Iter& it) : it (it) {}
|
|
||||||
machine_index_t (const machine_index_t& o) : it (o.it) {}
|
|
||||||
|
|
||||||
static constexpr bool is_random_access_iterator = Iter::is_random_access_iterator;
|
|
||||||
static constexpr bool is_sorted_iterator = Iter::is_sorted_iterator;
|
|
||||||
|
|
||||||
typename Iter::item_t __item__ () const { return *it; }
|
|
||||||
typename Iter::item_t __item_at__ (unsigned i) const { return it[i]; }
|
|
||||||
unsigned __len__ () const { return it.len (); }
|
|
||||||
void __next__ () { ++it; }
|
|
||||||
void __forward__ (unsigned n) { it += n; }
|
|
||||||
void __prev__ () { --it; }
|
|
||||||
void __rewind__ (unsigned n) { it -= n; }
|
|
||||||
void operator = (unsigned n)
|
|
||||||
{ unsigned index = (*it).first; if (index < n) it += n - index; else if (index > n) it -= index - n; }
|
|
||||||
void operator = (const machine_index_t& o) { *this = (*o.it).first; }
|
|
||||||
bool operator == (const machine_index_t& o) const { return (*it).first == (*o.it).first; }
|
|
||||||
bool operator != (const machine_index_t& o) const { return !(*this == o); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Iter it;
|
|
||||||
};
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
template <typename Iter,
|
|
||||||
hb_requires (hb_is_iterable (Iter))>
|
|
||||||
machine_index_t<hb_iter_type<Iter>>
|
|
||||||
operator () (Iter&& it) const
|
|
||||||
{ return machine_index_t<hb_iter_type<Iter>> (hb_iter (it)); }
|
|
||||||
}
|
|
||||||
HB_FUNCOBJ (machine_index);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* HB_OT_SHAPE_COMPLEX_MACHINE_INDEX_HH */
|
|
|
@ -32,10 +32,9 @@
|
||||||
#define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
|
#define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
|
||||||
|
|
||||||
#include "hb.hh"
|
#include "hb.hh"
|
||||||
#include "hb-ot-shape-complex-machine-index.hh"
|
|
||||||
|
|
||||||
|
|
||||||
#line 39 "hb-ot-shape-complex-use-machine.hh"
|
#line 38 "hb-ot-shape-complex-use-machine.hh"
|
||||||
static const unsigned char _use_syllable_machine_trans_keys[] = {
|
static const unsigned char _use_syllable_machine_trans_keys[] = {
|
||||||
1u, 1u, 1u, 1u, 0u, 51u, 11u, 48u, 11u, 48u, 1u, 1u, 22u, 48u, 23u, 48u,
|
1u, 1u, 1u, 1u, 0u, 51u, 11u, 48u, 11u, 48u, 1u, 1u, 22u, 48u, 23u, 48u,
|
||||||
24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u,
|
24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u,
|
||||||
|
@ -304,11 +303,11 @@ static const int use_syllable_machine_error = -1;
|
||||||
static const int use_syllable_machine_en_main = 2;
|
static const int use_syllable_machine_en_main = 2;
|
||||||
|
|
||||||
|
|
||||||
#line 39 "hb-ot-shape-complex-use-machine.rl"
|
#line 38 "hb-ot-shape-complex-use-machine.rl"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#line 154 "hb-ot-shape-complex-use-machine.rl"
|
#line 153 "hb-ot-shape-complex-use-machine.rl"
|
||||||
|
|
||||||
|
|
||||||
#define found_syllable(syllable_type) \
|
#define found_syllable(syllable_type) \
|
||||||
|
@ -351,7 +350,7 @@ find_syllables_use (hb_buffer_t *buffer)
|
||||||
unsigned int act HB_UNUSED;
|
unsigned int act HB_UNUSED;
|
||||||
int cs;
|
int cs;
|
||||||
|
|
||||||
#line 355 "hb-ot-shape-complex-use-machine.hh"
|
#line 354 "hb-ot-shape-complex-use-machine.hh"
|
||||||
{
|
{
|
||||||
cs = use_syllable_machine_start;
|
cs = use_syllable_machine_start;
|
||||||
ts = 0;
|
ts = 0;
|
||||||
|
@ -359,12 +358,12 @@ find_syllables_use (hb_buffer_t *buffer)
|
||||||
act = 0;
|
act = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#line 198 "hb-ot-shape-complex-use-machine.rl"
|
#line 197 "hb-ot-shape-complex-use-machine.rl"
|
||||||
|
|
||||||
|
|
||||||
unsigned int syllable_serial = 1;
|
unsigned int syllable_serial = 1;
|
||||||
|
|
||||||
#line 368 "hb-ot-shape-complex-use-machine.hh"
|
#line 367 "hb-ot-shape-complex-use-machine.hh"
|
||||||
{
|
{
|
||||||
int _slen;
|
int _slen;
|
||||||
int _trans;
|
int _trans;
|
||||||
|
@ -378,7 +377,7 @@ _resume:
|
||||||
#line 1 "NONE"
|
#line 1 "NONE"
|
||||||
{ts = p;}
|
{ts = p;}
|
||||||
break;
|
break;
|
||||||
#line 382 "hb-ot-shape-complex-use-machine.hh"
|
#line 381 "hb-ot-shape-complex-use-machine.hh"
|
||||||
}
|
}
|
||||||
|
|
||||||
_keys = _use_syllable_machine_trans_keys + (cs<<1);
|
_keys = _use_syllable_machine_trans_keys + (cs<<1);
|
||||||
|
@ -401,62 +400,62 @@ _eof_trans:
|
||||||
{te = p+1;}
|
{te = p+1;}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
#line 141 "hb-ot-shape-complex-use-machine.rl"
|
#line 140 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p+1;{ found_syllable (independent_cluster); }}
|
{te = p+1;{ found_syllable (independent_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
#line 144 "hb-ot-shape-complex-use-machine.rl"
|
#line 143 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p+1;{ found_syllable (standard_cluster); }}
|
{te = p+1;{ found_syllable (standard_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
#line 149 "hb-ot-shape-complex-use-machine.rl"
|
#line 148 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p+1;{ found_syllable (broken_cluster); }}
|
{te = p+1;{ found_syllable (broken_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
#line 150 "hb-ot-shape-complex-use-machine.rl"
|
#line 149 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p+1;{ found_syllable (non_cluster); }}
|
{te = p+1;{ found_syllable (non_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
#line 142 "hb-ot-shape-complex-use-machine.rl"
|
#line 141 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (virama_terminated_cluster); }}
|
{te = p;p--;{ found_syllable (virama_terminated_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
#line 143 "hb-ot-shape-complex-use-machine.rl"
|
#line 142 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (sakot_terminated_cluster); }}
|
{te = p;p--;{ found_syllable (sakot_terminated_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
#line 144 "hb-ot-shape-complex-use-machine.rl"
|
#line 143 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (standard_cluster); }}
|
{te = p;p--;{ found_syllable (standard_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
#line 145 "hb-ot-shape-complex-use-machine.rl"
|
#line 144 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (number_joiner_terminated_cluster); }}
|
{te = p;p--;{ found_syllable (number_joiner_terminated_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
#line 146 "hb-ot-shape-complex-use-machine.rl"
|
#line 145 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (numeral_cluster); }}
|
{te = p;p--;{ found_syllable (numeral_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
#line 147 "hb-ot-shape-complex-use-machine.rl"
|
#line 146 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (symbol_cluster); }}
|
{te = p;p--;{ found_syllable (symbol_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
#line 148 "hb-ot-shape-complex-use-machine.rl"
|
#line 147 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (hieroglyph_cluster); }}
|
{te = p;p--;{ found_syllable (hieroglyph_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
#line 149 "hb-ot-shape-complex-use-machine.rl"
|
#line 148 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (broken_cluster); }}
|
{te = p;p--;{ found_syllable (broken_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
#line 150 "hb-ot-shape-complex-use-machine.rl"
|
#line 149 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{te = p;p--;{ found_syllable (non_cluster); }}
|
{te = p;p--;{ found_syllable (non_cluster); }}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
#line 149 "hb-ot-shape-complex-use-machine.rl"
|
#line 148 "hb-ot-shape-complex-use-machine.rl"
|
||||||
{{p = ((te))-1;}{ found_syllable (broken_cluster); }}
|
{{p = ((te))-1;}{ found_syllable (broken_cluster); }}
|
||||||
break;
|
break;
|
||||||
#line 460 "hb-ot-shape-complex-use-machine.hh"
|
#line 459 "hb-ot-shape-complex-use-machine.hh"
|
||||||
}
|
}
|
||||||
|
|
||||||
_again:
|
_again:
|
||||||
|
@ -465,7 +464,7 @@ _again:
|
||||||
#line 1 "NONE"
|
#line 1 "NONE"
|
||||||
{ts = 0;}
|
{ts = 0;}
|
||||||
break;
|
break;
|
||||||
#line 469 "hb-ot-shape-complex-use-machine.hh"
|
#line 468 "hb-ot-shape-complex-use-machine.hh"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ++p != pe )
|
if ( ++p != pe )
|
||||||
|
@ -481,7 +480,7 @@ _again:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#line 203 "hb-ot-shape-complex-use-machine.rl"
|
#line 202 "hb-ot-shape-complex-use-machine.rl"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
|
#define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
|
||||||
|
|
||||||
#include "hb.hh"
|
#include "hb.hh"
|
||||||
#include "hb-ot-shape-complex-machine-index.hh"
|
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
machine use_syllable_machine;
|
machine use_syllable_machine;
|
||||||
|
|
|
@ -93,4 +93,43 @@ enum use_category_t {
|
||||||
HB_INTERNAL USE_TABLE_ELEMENT_TYPE
|
HB_INTERNAL USE_TABLE_ELEMENT_TYPE
|
||||||
hb_use_get_category (hb_codepoint_t u);
|
hb_use_get_category (hb_codepoint_t u);
|
||||||
|
|
||||||
|
|
||||||
|
template <typename Iter>
|
||||||
|
struct machine_index_t :
|
||||||
|
hb_iter_with_fallback_t<machine_index_t<Iter>,
|
||||||
|
typename Iter::item_t>
|
||||||
|
{
|
||||||
|
machine_index_t (const Iter& it) : it (it) {}
|
||||||
|
machine_index_t (const machine_index_t& o) : it (o.it) {}
|
||||||
|
|
||||||
|
static constexpr bool is_random_access_iterator = Iter::is_random_access_iterator;
|
||||||
|
static constexpr bool is_sorted_iterator = Iter::is_sorted_iterator;
|
||||||
|
|
||||||
|
typename Iter::item_t __item__ () const { return *it; }
|
||||||
|
typename Iter::item_t __item_at__ (unsigned i) const { return it[i]; }
|
||||||
|
unsigned __len__ () const { return it.len (); }
|
||||||
|
void __next__ () { ++it; }
|
||||||
|
void __forward__ (unsigned n) { it += n; }
|
||||||
|
void __prev__ () { --it; }
|
||||||
|
void __rewind__ (unsigned n) { it -= n; }
|
||||||
|
void operator = (unsigned n)
|
||||||
|
{ unsigned index = (*it).first; if (index < n) it += n - index; else if (index > n) it -= index - n; }
|
||||||
|
void operator = (const machine_index_t& o) { *this = (*o.it).first; }
|
||||||
|
bool operator == (const machine_index_t& o) const { return (*it).first == (*o.it).first; }
|
||||||
|
bool operator != (const machine_index_t& o) const { return !(*this == o); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
Iter it;
|
||||||
|
};
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
template <typename Iter,
|
||||||
|
hb_requires (hb_is_iterable (Iter))>
|
||||||
|
machine_index_t<hb_iter_type<Iter>>
|
||||||
|
operator () (Iter&& it) const
|
||||||
|
{ return machine_index_t<hb_iter_type<Iter>> (hb_iter (it)); }
|
||||||
|
}
|
||||||
|
HB_FUNCOBJ (machine_index);
|
||||||
|
|
||||||
|
|
||||||
#endif /* HB_OT_SHAPE_COMPLEX_USE_HH */
|
#endif /* HB_OT_SHAPE_COMPLEX_USE_HH */
|
||||||
|
|
Loading…
Reference in New Issue