diff --git a/src/hb-ot-shape-complex-indic-machine.hh b/src/hb-ot-shape-complex-indic-machine.hh index be3ec9998..6a0ad9c74 100644 --- a/src/hb-ot-shape-complex-indic-machine.hh +++ b/src/hb-ot-shape-complex-indic-machine.hh @@ -31,8 +31,17 @@ #include "hb.hh" +enum indic_syllable_type_t { + indic_consonant_syllable, + indic_vowel_syllable, + indic_standalone_cluster, + indic_symbol_cluster, + indic_broken_cluster, + indic_non_indic_cluster, +}; -#line 36 "hb-ot-shape-complex-indic-machine.hh" + +#line 45 "hb-ot-shape-complex-indic-machine.hh" #define indic_syllable_machine_ex_A 10u #define indic_syllable_machine_ex_C 1u #define indic_syllable_machine_ex_CM 17u @@ -52,7 +61,7 @@ #define indic_syllable_machine_ex_ZWNJ 5u -#line 56 "hb-ot-shape-complex-indic-machine.hh" +#line 65 "hb-ot-shape-complex-indic-machine.hh" static const unsigned char _indic_syllable_machine_trans_keys[] = { 8u, 8u, 4u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 4u, 13u, 4u, 8u, 8u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, 6u, 6u, 16u, 16u, @@ -404,11 +413,11 @@ static const int indic_syllable_machine_error = -1; static const int indic_syllable_machine_en_main = 39; -#line 37 "hb-ot-shape-complex-indic-machine.rl" +#line 46 "hb-ot-shape-complex-indic-machine.rl" -#line 93 "hb-ot-shape-complex-indic-machine.rl" +#line 102 "hb-ot-shape-complex-indic-machine.rl" #define found_syllable(syllable_type) \ @@ -427,7 +436,7 @@ find_syllables_indic (hb_buffer_t *buffer) int cs; hb_glyph_info_t *info = buffer->info; -#line 431 "hb-ot-shape-complex-indic-machine.hh" +#line 440 "hb-ot-shape-complex-indic-machine.hh" { cs = indic_syllable_machine_start; ts = 0; @@ -435,7 +444,7 @@ find_syllables_indic (hb_buffer_t *buffer) act = 0; } -#line 113 "hb-ot-shape-complex-indic-machine.rl" +#line 122 "hb-ot-shape-complex-indic-machine.rl" p = 0; @@ -443,7 +452,7 @@ find_syllables_indic (hb_buffer_t *buffer) unsigned int syllable_serial = 1; -#line 447 "hb-ot-shape-complex-indic-machine.hh" +#line 456 "hb-ot-shape-complex-indic-machine.hh" { int _slen; int _trans; @@ -457,7 +466,7 @@ _resume: #line 1 "NONE" {ts = p;} break; -#line 461 "hb-ot-shape-complex-indic-machine.hh" +#line 470 "hb-ot-shape-complex-indic-machine.hh" } _keys = _indic_syllable_machine_trans_keys + (cs<<1); @@ -480,51 +489,51 @@ _eof_trans: {te = p+1;} break; case 11: -#line 89 "hb-ot-shape-complex-indic-machine.rl" +#line 98 "hb-ot-shape-complex-indic-machine.rl" {te = p+1;{ found_syllable (non_indic_cluster); }} break; case 13: -#line 84 "hb-ot-shape-complex-indic-machine.rl" +#line 93 "hb-ot-shape-complex-indic-machine.rl" {te = p;p--;{ found_syllable (consonant_syllable); }} break; case 14: -#line 85 "hb-ot-shape-complex-indic-machine.rl" +#line 94 "hb-ot-shape-complex-indic-machine.rl" {te = p;p--;{ found_syllable (vowel_syllable); }} break; case 17: -#line 86 "hb-ot-shape-complex-indic-machine.rl" +#line 95 "hb-ot-shape-complex-indic-machine.rl" {te = p;p--;{ found_syllable (standalone_cluster); }} break; case 19: -#line 87 "hb-ot-shape-complex-indic-machine.rl" +#line 96 "hb-ot-shape-complex-indic-machine.rl" {te = p;p--;{ found_syllable (symbol_cluster); }} break; case 15: -#line 88 "hb-ot-shape-complex-indic-machine.rl" +#line 97 "hb-ot-shape-complex-indic-machine.rl" {te = p;p--;{ found_syllable (broken_cluster); }} break; case 16: -#line 89 "hb-ot-shape-complex-indic-machine.rl" +#line 98 "hb-ot-shape-complex-indic-machine.rl" {te = p;p--;{ found_syllable (non_indic_cluster); }} break; case 1: -#line 84 "hb-ot-shape-complex-indic-machine.rl" +#line 93 "hb-ot-shape-complex-indic-machine.rl" {{p = ((te))-1;}{ found_syllable (consonant_syllable); }} break; case 3: -#line 85 "hb-ot-shape-complex-indic-machine.rl" +#line 94 "hb-ot-shape-complex-indic-machine.rl" {{p = ((te))-1;}{ found_syllable (vowel_syllable); }} break; case 7: -#line 86 "hb-ot-shape-complex-indic-machine.rl" +#line 95 "hb-ot-shape-complex-indic-machine.rl" {{p = ((te))-1;}{ found_syllable (standalone_cluster); }} break; case 8: -#line 87 "hb-ot-shape-complex-indic-machine.rl" +#line 96 "hb-ot-shape-complex-indic-machine.rl" {{p = ((te))-1;}{ found_syllable (symbol_cluster); }} break; case 4: -#line 88 "hb-ot-shape-complex-indic-machine.rl" +#line 97 "hb-ot-shape-complex-indic-machine.rl" {{p = ((te))-1;}{ found_syllable (broken_cluster); }} break; case 6: @@ -545,22 +554,22 @@ _eof_trans: case 18: #line 1 "NONE" {te = p+1;} -#line 84 "hb-ot-shape-complex-indic-machine.rl" +#line 93 "hb-ot-shape-complex-indic-machine.rl" {act = 1;} break; case 5: #line 1 "NONE" {te = p+1;} -#line 88 "hb-ot-shape-complex-indic-machine.rl" +#line 97 "hb-ot-shape-complex-indic-machine.rl" {act = 5;} break; case 12: #line 1 "NONE" {te = p+1;} -#line 89 "hb-ot-shape-complex-indic-machine.rl" +#line 98 "hb-ot-shape-complex-indic-machine.rl" {act = 6;} break; -#line 564 "hb-ot-shape-complex-indic-machine.hh" +#line 573 "hb-ot-shape-complex-indic-machine.hh" } _again: @@ -569,7 +578,7 @@ _again: #line 1 "NONE" {ts = 0;} break; -#line 573 "hb-ot-shape-complex-indic-machine.hh" +#line 582 "hb-ot-shape-complex-indic-machine.hh" } if ( ++p != pe ) @@ -585,7 +594,7 @@ _again: } -#line 121 "hb-ot-shape-complex-indic-machine.rl" +#line 130 "hb-ot-shape-complex-indic-machine.rl" } diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index e2e9800c4..058b793fd 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -29,6 +29,15 @@ #include "hb.hh" +enum indic_syllable_type_t { + indic_consonant_syllable, + indic_vowel_syllable, + indic_standalone_cluster, + indic_symbol_cluster, + indic_broken_cluster, + indic_non_indic_cluster, +}; + %%{ machine indic_syllable_machine; alphtype unsigned char; diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 9c477471e..09742b391 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -29,6 +29,7 @@ #ifndef HB_NO_OT_SHAPE #include "hb-ot-shape-complex-indic.hh" +#include "hb-ot-shape-complex-indic-machine.hh" #include "hb-ot-shape-complex-vowel-constraints.hh" #include "hb-ot-layout.hh" @@ -337,19 +338,6 @@ consonant_position_from_face (const indic_shape_plan_t *indic_plan, return POS_BASE_C; } - -enum indic_syllable_type_t { - indic_consonant_syllable, - indic_vowel_syllable, - indic_standalone_cluster, - indic_symbol_cluster, - indic_broken_cluster, - indic_non_indic_cluster, -}; - -#include "hb-ot-shape-complex-indic-machine.hh" - - static void setup_masks_indic (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, diff --git a/src/hb-ot-shape-complex-khmer-machine.hh b/src/hb-ot-shape-complex-khmer-machine.hh index f0b6107f4..c7d8bad86 100644 --- a/src/hb-ot-shape-complex-khmer-machine.hh +++ b/src/hb-ot-shape-complex-khmer-machine.hh @@ -31,8 +31,14 @@ #include "hb.hh" +enum khmer_syllable_type_t { + khmer_consonant_syllable, + khmer_broken_cluster, + khmer_non_khmer_cluster, +}; -#line 36 "hb-ot-shape-complex-khmer-machine.hh" + +#line 42 "hb-ot-shape-complex-khmer-machine.hh" #define khmer_syllable_machine_ex_C 1u #define khmer_syllable_machine_ex_Coeng 14u #define khmer_syllable_machine_ex_DOTTEDCIRCLE 12u @@ -50,7 +56,7 @@ #define khmer_syllable_machine_ex_ZWNJ 5u -#line 54 "hb-ot-shape-complex-khmer-machine.hh" +#line 60 "hb-ot-shape-complex-khmer-machine.hh" static const unsigned char _khmer_syllable_machine_trans_keys[] = { 5u, 26u, 5u, 21u, 5u, 26u, 5u, 21u, 1u, 16u, 5u, 21u, 5u, 26u, 5u, 21u, 5u, 26u, 5u, 21u, 5u, 21u, 5u, 26u, 5u, 21u, 1u, 16u, 5u, 21u, 5u, 26u, @@ -233,11 +239,11 @@ static const int khmer_syllable_machine_error = -1; static const int khmer_syllable_machine_en_main = 20; -#line 37 "hb-ot-shape-complex-khmer-machine.rl" +#line 43 "hb-ot-shape-complex-khmer-machine.rl" -#line 80 "hb-ot-shape-complex-khmer-machine.rl" +#line 86 "hb-ot-shape-complex-khmer-machine.rl" #define found_syllable(syllable_type) \ @@ -256,7 +262,7 @@ find_syllables_khmer (hb_buffer_t *buffer) int cs; hb_glyph_info_t *info = buffer->info; -#line 260 "hb-ot-shape-complex-khmer-machine.hh" +#line 266 "hb-ot-shape-complex-khmer-machine.hh" { cs = khmer_syllable_machine_start; ts = 0; @@ -264,7 +270,7 @@ find_syllables_khmer (hb_buffer_t *buffer) act = 0; } -#line 100 "hb-ot-shape-complex-khmer-machine.rl" +#line 106 "hb-ot-shape-complex-khmer-machine.rl" p = 0; @@ -272,7 +278,7 @@ find_syllables_khmer (hb_buffer_t *buffer) unsigned int syllable_serial = 1; -#line 276 "hb-ot-shape-complex-khmer-machine.hh" +#line 282 "hb-ot-shape-complex-khmer-machine.hh" { int _slen; int _trans; @@ -286,7 +292,7 @@ _resume: #line 1 "NONE" {ts = p;} break; -#line 290 "hb-ot-shape-complex-khmer-machine.hh" +#line 296 "hb-ot-shape-complex-khmer-machine.hh" } _keys = _khmer_syllable_machine_trans_keys + (cs<<1); @@ -309,27 +315,27 @@ _eof_trans: {te = p+1;} break; case 8: -#line 76 "hb-ot-shape-complex-khmer-machine.rl" +#line 82 "hb-ot-shape-complex-khmer-machine.rl" {te = p+1;{ found_syllable (non_khmer_cluster); }} break; case 10: -#line 74 "hb-ot-shape-complex-khmer-machine.rl" +#line 80 "hb-ot-shape-complex-khmer-machine.rl" {te = p;p--;{ found_syllable (consonant_syllable); }} break; case 12: -#line 75 "hb-ot-shape-complex-khmer-machine.rl" +#line 81 "hb-ot-shape-complex-khmer-machine.rl" {te = p;p--;{ found_syllable (broken_cluster); }} break; case 11: -#line 76 "hb-ot-shape-complex-khmer-machine.rl" +#line 82 "hb-ot-shape-complex-khmer-machine.rl" {te = p;p--;{ found_syllable (non_khmer_cluster); }} break; case 1: -#line 74 "hb-ot-shape-complex-khmer-machine.rl" +#line 80 "hb-ot-shape-complex-khmer-machine.rl" {{p = ((te))-1;}{ found_syllable (consonant_syllable); }} break; case 5: -#line 75 "hb-ot-shape-complex-khmer-machine.rl" +#line 81 "hb-ot-shape-complex-khmer-machine.rl" {{p = ((te))-1;}{ found_syllable (broken_cluster); }} break; case 3: @@ -347,16 +353,16 @@ _eof_trans: case 4: #line 1 "NONE" {te = p+1;} -#line 75 "hb-ot-shape-complex-khmer-machine.rl" +#line 81 "hb-ot-shape-complex-khmer-machine.rl" {act = 2;} break; case 9: #line 1 "NONE" {te = p+1;} -#line 76 "hb-ot-shape-complex-khmer-machine.rl" +#line 82 "hb-ot-shape-complex-khmer-machine.rl" {act = 3;} break; -#line 360 "hb-ot-shape-complex-khmer-machine.hh" +#line 366 "hb-ot-shape-complex-khmer-machine.hh" } _again: @@ -365,7 +371,7 @@ _again: #line 1 "NONE" {ts = 0;} break; -#line 369 "hb-ot-shape-complex-khmer-machine.hh" +#line 375 "hb-ot-shape-complex-khmer-machine.hh" } if ( ++p != pe ) @@ -381,7 +387,7 @@ _again: } -#line 108 "hb-ot-shape-complex-khmer-machine.rl" +#line 114 "hb-ot-shape-complex-khmer-machine.rl" } diff --git a/src/hb-ot-shape-complex-khmer-machine.rl b/src/hb-ot-shape-complex-khmer-machine.rl index 1b023c95c..56154e65f 100644 --- a/src/hb-ot-shape-complex-khmer-machine.rl +++ b/src/hb-ot-shape-complex-khmer-machine.rl @@ -29,6 +29,12 @@ #include "hb.hh" +enum khmer_syllable_type_t { + khmer_consonant_syllable, + khmer_broken_cluster, + khmer_non_khmer_cluster, +}; + %%{ machine khmer_syllable_machine; alphtype unsigned char; diff --git a/src/hb-ot-shape-complex-khmer.cc b/src/hb-ot-shape-complex-khmer.cc index b873da074..11c79b207 100644 --- a/src/hb-ot-shape-complex-khmer.cc +++ b/src/hb-ot-shape-complex-khmer.cc @@ -29,6 +29,7 @@ #ifndef HB_NO_OT_SHAPE #include "hb-ot-shape-complex-khmer.hh" +#include "hb-ot-shape-complex-khmer-machine.hh" #include "hb-ot-layout.hh" @@ -186,15 +187,6 @@ data_destroy_khmer (void *data) free (data); } - -enum khmer_syllable_type_t { - khmer_consonant_syllable, - khmer_broken_cluster, - khmer_non_khmer_cluster, -}; - -#include "hb-ot-shape-complex-khmer-machine.hh" - static void setup_masks_khmer (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, diff --git a/src/hb-ot-shape-complex-myanmar-machine.hh b/src/hb-ot-shape-complex-myanmar-machine.hh index 8ccf79063..0fda4ebc1 100644 --- a/src/hb-ot-shape-complex-myanmar-machine.hh +++ b/src/hb-ot-shape-complex-myanmar-machine.hh @@ -31,8 +31,15 @@ #include "hb.hh" +enum myanmar_syllable_type_t { + myanmar_consonant_syllable, + myanmar_punctuation_cluster, + myanmar_broken_cluster, + myanmar_non_myanmar_cluster, +}; -#line 36 "hb-ot-shape-complex-myanmar-machine.hh" + +#line 43 "hb-ot-shape-complex-myanmar-machine.hh" #define myanmar_syllable_machine_ex_A 10u #define myanmar_syllable_machine_ex_As 18u #define myanmar_syllable_machine_ex_C 1u @@ -60,7 +67,7 @@ #define myanmar_syllable_machine_ex_ZWNJ 5u -#line 64 "hb-ot-shape-complex-myanmar-machine.hh" +#line 71 "hb-ot-shape-complex-myanmar-machine.hh" static const unsigned char _myanmar_syllable_machine_trans_keys[] = { 1u, 32u, 3u, 30u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 16u, 3u, 29u, 3u, 29u, 3u, 29u, @@ -321,11 +328,11 @@ static const int myanmar_syllable_machine_error = -1; static const int myanmar_syllable_machine_en_main = 0; -#line 37 "hb-ot-shape-complex-myanmar-machine.rl" +#line 44 "hb-ot-shape-complex-myanmar-machine.rl" -#line 94 "hb-ot-shape-complex-myanmar-machine.rl" +#line 101 "hb-ot-shape-complex-myanmar-machine.rl" #define found_syllable(syllable_type) \ @@ -344,7 +351,7 @@ find_syllables_myanmar (hb_buffer_t *buffer) int cs; hb_glyph_info_t *info = buffer->info; -#line 348 "hb-ot-shape-complex-myanmar-machine.hh" +#line 355 "hb-ot-shape-complex-myanmar-machine.hh" { cs = myanmar_syllable_machine_start; ts = 0; @@ -352,7 +359,7 @@ find_syllables_myanmar (hb_buffer_t *buffer) act = 0; } -#line 114 "hb-ot-shape-complex-myanmar-machine.rl" +#line 121 "hb-ot-shape-complex-myanmar-machine.rl" p = 0; @@ -360,7 +367,7 @@ find_syllables_myanmar (hb_buffer_t *buffer) unsigned int syllable_serial = 1; -#line 364 "hb-ot-shape-complex-myanmar-machine.hh" +#line 371 "hb-ot-shape-complex-myanmar-machine.hh" { int _slen; int _trans; @@ -374,7 +381,7 @@ _resume: #line 1 "NONE" {ts = p;} break; -#line 378 "hb-ot-shape-complex-myanmar-machine.hh" +#line 385 "hb-ot-shape-complex-myanmar-machine.hh" } _keys = _myanmar_syllable_machine_trans_keys + (cs<<1); @@ -393,38 +400,38 @@ _eof_trans: switch ( _myanmar_syllable_machine_trans_actions[_trans] ) { case 6: -#line 86 "hb-ot-shape-complex-myanmar-machine.rl" +#line 93 "hb-ot-shape-complex-myanmar-machine.rl" {te = p+1;{ found_syllable (consonant_syllable); }} break; case 4: -#line 87 "hb-ot-shape-complex-myanmar-machine.rl" +#line 94 "hb-ot-shape-complex-myanmar-machine.rl" {te = p+1;{ found_syllable (non_myanmar_cluster); }} break; case 10: -#line 88 "hb-ot-shape-complex-myanmar-machine.rl" +#line 95 "hb-ot-shape-complex-myanmar-machine.rl" {te = p+1;{ found_syllable (punctuation_cluster); }} break; case 8: -#line 89 "hb-ot-shape-complex-myanmar-machine.rl" +#line 96 "hb-ot-shape-complex-myanmar-machine.rl" {te = p+1;{ found_syllable (broken_cluster); }} break; case 3: -#line 90 "hb-ot-shape-complex-myanmar-machine.rl" +#line 97 "hb-ot-shape-complex-myanmar-machine.rl" {te = p+1;{ found_syllable (non_myanmar_cluster); }} break; case 5: -#line 86 "hb-ot-shape-complex-myanmar-machine.rl" +#line 93 "hb-ot-shape-complex-myanmar-machine.rl" {te = p;p--;{ found_syllable (consonant_syllable); }} break; case 7: -#line 89 "hb-ot-shape-complex-myanmar-machine.rl" +#line 96 "hb-ot-shape-complex-myanmar-machine.rl" {te = p;p--;{ found_syllable (broken_cluster); }} break; case 9: -#line 90 "hb-ot-shape-complex-myanmar-machine.rl" +#line 97 "hb-ot-shape-complex-myanmar-machine.rl" {te = p;p--;{ found_syllable (non_myanmar_cluster); }} break; -#line 428 "hb-ot-shape-complex-myanmar-machine.hh" +#line 435 "hb-ot-shape-complex-myanmar-machine.hh" } _again: @@ -433,7 +440,7 @@ _again: #line 1 "NONE" {ts = 0;} break; -#line 437 "hb-ot-shape-complex-myanmar-machine.hh" +#line 444 "hb-ot-shape-complex-myanmar-machine.hh" } if ( ++p != pe ) @@ -449,7 +456,7 @@ _again: } -#line 122 "hb-ot-shape-complex-myanmar-machine.rl" +#line 129 "hb-ot-shape-complex-myanmar-machine.rl" } diff --git a/src/hb-ot-shape-complex-myanmar-machine.rl b/src/hb-ot-shape-complex-myanmar-machine.rl index a92d1d709..8ff294416 100644 --- a/src/hb-ot-shape-complex-myanmar-machine.rl +++ b/src/hb-ot-shape-complex-myanmar-machine.rl @@ -29,6 +29,13 @@ #include "hb.hh" +enum myanmar_syllable_type_t { + myanmar_consonant_syllable, + myanmar_punctuation_cluster, + myanmar_broken_cluster, + myanmar_non_myanmar_cluster, +}; + %%{ machine myanmar_syllable_machine; alphtype unsigned char; diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc index eae5da96c..bc5dcb904 100644 --- a/src/hb-ot-shape-complex-myanmar.cc +++ b/src/hb-ot-shape-complex-myanmar.cc @@ -29,6 +29,7 @@ #ifndef HB_NO_OT_SHAPE #include "hb-ot-shape-complex-myanmar.hh" +#include "hb-ot-shape-complex-myanmar-machine.hh" /* @@ -97,17 +98,6 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan) map->enable_feature (myanmar_other_features[i], F_MANUAL_ZWJ); } - -enum myanmar_syllable_type_t { - myanmar_consonant_syllable, - myanmar_punctuation_cluster, - myanmar_broken_cluster, - myanmar_non_myanmar_cluster, -}; - -#include "hb-ot-shape-complex-myanmar-machine.hh" - - static void setup_masks_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, diff --git a/src/hb-ot-shape-complex-use-machine.hh b/src/hb-ot-shape-complex-use-machine.hh index c8c392e08..9892ce000 100644 --- a/src/hb-ot-shape-complex-use-machine.hh +++ b/src/hb-ot-shape-complex-use-machine.hh @@ -33,8 +33,24 @@ #include "hb.hh" +/* buffer var allocations */ +#define use_category() complex_var_u8_category() -#line 38 "hb-ot-shape-complex-use-machine.hh" +enum use_syllable_type_t { + use_independent_cluster, + use_virama_terminated_cluster, + use_sakot_terminated_cluster, + use_standard_cluster, + use_number_joiner_terminated_cluster, + use_numeral_cluster, + use_symbol_cluster, + use_hieroglyph_cluster, + use_broken_cluster, + use_non_cluster, +}; + + +#line 54 "hb-ot-shape-complex-use-machine.hh" #define use_syllable_machine_ex_B 1u #define use_syllable_machine_ex_CMAbv 31u #define use_syllable_machine_ex_CMBlw 32u @@ -76,7 +92,7 @@ #define use_syllable_machine_ex_ZWNJ 14u -#line 80 "hb-ot-shape-complex-use-machine.hh" +#line 96 "hb-ot-shape-complex-use-machine.hh" 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, 24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u, @@ -345,11 +361,11 @@ static const int use_syllable_machine_error = -1; static const int use_syllable_machine_en_main = 2; -#line 39 "hb-ot-shape-complex-use-machine.rl" +#line 55 "hb-ot-shape-complex-use-machine.rl" -#line 152 "hb-ot-shape-complex-use-machine.rl" +#line 168 "hb-ot-shape-complex-use-machine.rl" #define found_syllable(syllable_type) \ @@ -392,7 +408,7 @@ find_syllables_use (hb_buffer_t *buffer) unsigned int act HB_UNUSED; int cs; -#line 396 "hb-ot-shape-complex-use-machine.hh" +#line 412 "hb-ot-shape-complex-use-machine.hh" { cs = use_syllable_machine_start; ts = 0; @@ -400,12 +416,12 @@ find_syllables_use (hb_buffer_t *buffer) act = 0; } -#line 196 "hb-ot-shape-complex-use-machine.rl" +#line 212 "hb-ot-shape-complex-use-machine.rl" unsigned int syllable_serial = 1; -#line 409 "hb-ot-shape-complex-use-machine.hh" +#line 425 "hb-ot-shape-complex-use-machine.hh" { int _slen; int _trans; @@ -419,7 +435,7 @@ _resume: #line 1 "NONE" {ts = p;} break; -#line 423 "hb-ot-shape-complex-use-machine.hh" +#line 439 "hb-ot-shape-complex-use-machine.hh" } _keys = _use_syllable_machine_trans_keys + (cs<<1); @@ -442,62 +458,62 @@ _eof_trans: {te = p+1;} break; case 5: -#line 139 "hb-ot-shape-complex-use-machine.rl" +#line 155 "hb-ot-shape-complex-use-machine.rl" {te = p+1;{ found_syllable (independent_cluster); }} break; case 9: -#line 142 "hb-ot-shape-complex-use-machine.rl" +#line 158 "hb-ot-shape-complex-use-machine.rl" {te = p+1;{ found_syllable (standard_cluster); }} break; case 7: -#line 147 "hb-ot-shape-complex-use-machine.rl" +#line 163 "hb-ot-shape-complex-use-machine.rl" {te = p+1;{ found_syllable (broken_cluster); }} break; case 6: -#line 148 "hb-ot-shape-complex-use-machine.rl" +#line 164 "hb-ot-shape-complex-use-machine.rl" {te = p+1;{ found_syllable (non_cluster); }} break; case 10: -#line 140 "hb-ot-shape-complex-use-machine.rl" +#line 156 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (virama_terminated_cluster); }} break; case 11: -#line 141 "hb-ot-shape-complex-use-machine.rl" +#line 157 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (sakot_terminated_cluster); }} break; case 8: -#line 142 "hb-ot-shape-complex-use-machine.rl" +#line 158 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (standard_cluster); }} break; case 13: -#line 143 "hb-ot-shape-complex-use-machine.rl" +#line 159 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (number_joiner_terminated_cluster); }} break; case 12: -#line 144 "hb-ot-shape-complex-use-machine.rl" +#line 160 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (numeral_cluster); }} break; case 14: -#line 145 "hb-ot-shape-complex-use-machine.rl" +#line 161 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (symbol_cluster); }} break; case 17: -#line 146 "hb-ot-shape-complex-use-machine.rl" +#line 162 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (hieroglyph_cluster); }} break; case 15: -#line 147 "hb-ot-shape-complex-use-machine.rl" +#line 163 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (broken_cluster); }} break; case 16: -#line 148 "hb-ot-shape-complex-use-machine.rl" +#line 164 "hb-ot-shape-complex-use-machine.rl" {te = p;p--;{ found_syllable (non_cluster); }} break; case 1: -#line 147 "hb-ot-shape-complex-use-machine.rl" +#line 163 "hb-ot-shape-complex-use-machine.rl" {{p = ((te))-1;}{ found_syllable (broken_cluster); }} break; -#line 501 "hb-ot-shape-complex-use-machine.hh" +#line 517 "hb-ot-shape-complex-use-machine.hh" } _again: @@ -506,7 +522,7 @@ _again: #line 1 "NONE" {ts = 0;} break; -#line 510 "hb-ot-shape-complex-use-machine.hh" +#line 526 "hb-ot-shape-complex-use-machine.hh" } if ( ++p != pe ) @@ -522,7 +538,7 @@ _again: } -#line 201 "hb-ot-shape-complex-use-machine.rl" +#line 217 "hb-ot-shape-complex-use-machine.rl" } diff --git a/src/hb-ot-shape-complex-use-machine.rl b/src/hb-ot-shape-complex-use-machine.rl index 9f2a1834f..4c248e60b 100644 --- a/src/hb-ot-shape-complex-use-machine.rl +++ b/src/hb-ot-shape-complex-use-machine.rl @@ -31,6 +31,22 @@ #include "hb.hh" +/* buffer var allocations */ +#define use_category() complex_var_u8_category() + +enum use_syllable_type_t { + use_independent_cluster, + use_virama_terminated_cluster, + use_sakot_terminated_cluster, + use_standard_cluster, + use_number_joiner_terminated_cluster, + use_numeral_cluster, + use_symbol_cluster, + use_hieroglyph_cluster, + use_broken_cluster, + use_non_cluster, +}; + %%{ machine use_syllable_machine; alphtype unsigned char; diff --git a/src/hb-ot-shape-complex-use.cc b/src/hb-ot-shape-complex-use.cc index 5b261c36a..23a0b3c24 100644 --- a/src/hb-ot-shape-complex-use.cc +++ b/src/hb-ot-shape-complex-use.cc @@ -31,13 +31,11 @@ #ifndef HB_NO_OT_SHAPE #include "hb-ot-shape-complex-use.hh" +#include "hb-ot-shape-complex-use-machine.hh" #include "hb-ot-shape-complex-arabic.hh" #include "hb-ot-shape-complex-arabic-joining-list.hh" #include "hb-ot-shape-complex-vowel-constraints.hh" -/* buffer var allocations */ -#define use_category() complex_var_u8_category() - /* * Universal Shaping Engine. @@ -186,22 +184,6 @@ data_destroy_use (void *data) free (data); } -enum use_syllable_type_t { - use_independent_cluster, - use_virama_terminated_cluster, - use_sakot_terminated_cluster, - use_standard_cluster, - use_number_joiner_terminated_cluster, - use_numeral_cluster, - use_symbol_cluster, - use_hieroglyph_cluster, - use_broken_cluster, - use_non_cluster, -}; - -#include "hb-ot-shape-complex-use-machine.hh" - - static void setup_masks_use (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer,