summaryrefslogtreecommitdiff
path: root/source/luametatex/source/tex/texnodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/luametatex/source/tex/texnodes.h')
-rw-r--r--source/luametatex/source/tex/texnodes.h136
1 files changed, 73 insertions, 63 deletions
diff --git a/source/luametatex/source/tex/texnodes.h b/source/luametatex/source/tex/texnodes.h
index 9e24ada27..50dbeaa97 100644
--- a/source/luametatex/source/tex/texnodes.h
+++ b/source/luametatex/source/tex/texnodes.h
@@ -130,8 +130,9 @@ typedef enum node_types {
align_stack_node,
noad_state_node,
if_node,
- unhyphenated_node, /*tex These are both active nodes. */
- hyphenated_node, /*tex These are both active nodes. */
+ /*tex These two are active nodes. */
+ unhyphenated_node,
+ hyphenated_node,
delta_node,
passive_node,
} node_types;
@@ -988,17 +989,17 @@ typedef enum rule_codes {
# define first_rule_code normal_rule_code
# define last_rule_code strut_rule_code
-# define rule_node_size 7
-# define rule_width(a) vlink(a,2)
-# define rule_x_offset(a) vinfo(a,2)
-# define rule_depth(a) vlink(a,3)
-# define rule_y_offset(a) vinfo(a,3)
-# define rule_height(a) vlink(a,4)
-# define rule_data(a) vinfo(a,4)
-# define rule_left(a) vinfo(a,5)
-# define rule_right(a) vlink(a,5)
-# define rule_font(a) vinfo(a,6)
-# define rule_character(a) vlink(a,6)
+# define rule_node_size 7
+# define rule_width(a) vlink(a,2)
+# define rule_x_offset(a) vinfo(a,2)
+# define rule_depth(a) vlink(a,3)
+# define rule_y_offset(a) vinfo(a,3)
+# define rule_height(a) vlink(a,4)
+# define rule_data(a) vinfo(a,4)
+# define rule_left(a) vinfo(a,5)
+# define rule_right(a) vlink(a,5)
+# define rule_font(a) vinfo(a,6)
+# define rule_character(a) vlink(a,6)
# define rule_total(a) (rule_height(a) + rule_depth(a))
@@ -1057,36 +1058,36 @@ typedef enum rule_codes {
*/
-//define glyph_node_size 12
-# define glyph_node_size 13
-# define glyph_character(a) vinfo(a,2)
-# define glyph_font(a) vlink(a,2)
-# define glyph_data(a) vinfo(a,3) /*tex We had that unused, so now it's like an attribute. */
-# define glyph_state(a) vlink(a,3) /*tex A user field (can be handy in \LUA). */
-# define glyph_language(a) vinfo(a,4)
-# define glyph_script(a) vlink(a,4)
-# define glyph_options(a) vinfo(a,5)
-# define glyph_hyphenate(a) vlink(a,5)
-# define glyph_protected(a) vinfo00(a,6)
-# define glyph_lhmin(a) vinfo01(a,6)
-# define glyph_rhmin(a) vinfo02(a,6)
-# define glyph_discpart(a) vinfo03(a,6)
-# define glyph_expansion(a) vlink(a,6)
-# define glyph_x_scale(a) vinfo(a,7)
-# define glyph_y_scale(a) vlink(a,7)
-# define glyph_scale(a) vinfo(a,8)
-# define glyph_raise(a) vlink(a,8)
-# define glyph_left(a) vinfo(a,9)
-# define glyph_right(a) vlink(a,9)
-# define glyph_x_offset(a) vinfo(a,10)
-# define glyph_y_offset(a) vlink(a,10)
-//define glyph_input_file(a) vinfo(a,11) /* aka glyph_synctex_tag */
-//define glyph_input_line(a) vlink(a,11) /* aka glyph_synctex_line */
-# define glyph_properties(a) vinfo0(a,11)
-# define glyph_group(a) vinfo1(a,11)
-# define glyph_index(a) vlink(a,11)
-# define glyph_input_file(a) vinfo(a,12)
-# define glyph_input_line(a) vlink(a,12)
+//define glyph_node_size 12
+# define glyph_node_size 13
+# define glyph_character(a) vinfo(a,2)
+# define glyph_font(a) vlink(a,2)
+# define glyph_data(a) vinfo(a,3) /*tex We had that unused, so now it's like an attribute. */
+# define glyph_state(a) vlink(a,3) /*tex A user field (can be handy in \LUA). */
+# define glyph_language(a) vinfo(a,4)
+# define glyph_script(a) vlink(a,4)
+# define glyph_options(a) vinfo(a,5)
+# define glyph_hyphenate(a) vlink(a,5)
+# define glyph_protected(a) vinfo00(a,6)
+# define glyph_lhmin(a) vinfo01(a,6)
+# define glyph_rhmin(a) vinfo02(a,6)
+# define glyph_discpart(a) vinfo03(a,6)
+# define glyph_expansion(a) vlink(a,6)
+# define glyph_x_scale(a) vinfo(a,7)
+# define glyph_y_scale(a) vlink(a,7)
+# define glyph_scale(a) vinfo(a,8)
+# define glyph_raise(a) vlink(a,8)
+# define glyph_left(a) vinfo(a,9)
+# define glyph_right(a) vlink(a,9)
+# define glyph_x_offset(a) vinfo(a,10)
+# define glyph_y_offset(a) vlink(a,10)
+//define glyph_input_file(a) vinfo(a,11) /* aka glyph_synctex_tag */
+//define glyph_input_line(a) vlink(a,11) /* aka glyph_synctex_line */
+# define glyph_properties(a) vinfo0(a,11)
+# define glyph_group(a) vinfo1(a,11)
+# define glyph_index(a) vlink(a,11)
+# define glyph_input_file(a) vinfo(a,12)
+# define glyph_input_line(a) vlink(a,12)
# define get_glyph_data(a) ((halfword) glyph_data(a))
# define get_glyph_state(a) ((halfword) glyph_state(a))
@@ -1477,6 +1478,10 @@ typedef enum specification_options {
# define specification_n(a,n) (specification_repeat(a) ? ((n - 1) % specification_count(a) + 1) : (n > specification_count(a) ? specification_count(a) : n))
+/* interesting: 1Kb smaller bin: */
+
+// inline static halfword specification_n(halfword a, halfword n) { return specification_repeat(a) ? ((n - 1) % specification_count(a) + 1) : (n > specification_count(a) ? specification_count(a) : n); }
+
extern void tex_null_specification_list (halfword a);
extern void tex_new_specification_list (halfword a, halfword n, halfword o);
extern void tex_dispose_specification_list (halfword a);
@@ -1596,15 +1601,15 @@ typedef enum simple_choice_subtypes {
*/
-# define noad_state_node_size 6
-# define noad_state_topright(a) vlink(a,2)
-# define noad_state_bottomright(a) vinfo(a,2)
-# define noad_state_topleft(a) vlink(a,3)
-# define noad_state_bottomleft(a) vinfo(a,3)
-# define noad_state_height(a) vlink(a,4)
-# define noad_state_depth(a) vinfo(a,4)
-# define noad_state_toptotal(a) vlink(a,5)
-# define noad_state_bottomtotal(a) vinfo(a,5)
+# define noad_state_node_size 6
+# define noad_state_topright(a) vlink(a,2)
+# define noad_state_bottomright(a) vinfo(a,2)
+# define noad_state_topleft(a) vlink(a,3)
+# define noad_state_bottomleft(a) vinfo(a,3)
+# define noad_state_height(a) vlink(a,4)
+# define noad_state_depth(a) vinfo(a,4)
+# define noad_state_toptotal(a) vlink(a,5)
+# define noad_state_bottomtotal(a) vinfo(a,5)
# define noad_size 14
# define noad_new_hlist(a) vlink(a,2) /*tex the translation of an mlist; a bit confusing name */
@@ -1754,7 +1759,7 @@ inline static void tex_add_noad_option (halfword a, halfword r) { noad_option
inline static void tex_remove_noad_option (halfword a, halfword r) { noad_options(a) &= ~(r | noad_options(a)); }
inline static int tex_has_noad_option (halfword a, halfword r) { return (noad_options(a) & r) == r; }
-inline int has_noad_no_script_option(halfword n, halfword option)
+inline static int has_noad_no_script_option(halfword n, halfword option)
{
switch (node_type(n)) {
case simple_noad:
@@ -1880,13 +1885,13 @@ typedef enum math_modifier_types {
/*tex accent noads: todo, left and right offsets and options */
-# define accent_noad_size noad_size
-# define accent_top_character noad_extra_1 /*tex the |top_accent_chr| field of an accent noad */
-# define accent_bottom_character noad_extra_2 /*tex the |bot_accent_chr| field of an accent noad */
-# define accent_middle_character noad_extra_3 /*tex the |overlay_accent_chr| field of an accent noad */
-# define accent_fraction noad_extra_4
-# define accent_top_overshoot noad_extra_5
-# define accent_bot_overshoot noad_extra_6
+# define accent_noad_size noad_size
+# define accent_top_character noad_extra_1 /*tex the |top_accent_chr| field of an accent noad */
+# define accent_bottom_character noad_extra_2 /*tex the |bot_accent_chr| field of an accent noad */
+# define accent_middle_character noad_extra_3 /*tex the |overlay_accent_chr| field of an accent noad */
+# define accent_fraction noad_extra_4
+# define accent_top_overshoot noad_extra_5
+# define accent_bot_overshoot noad_extra_6
typedef enum math_accent_subtypes {
bothflexible_accent_subtype,
@@ -1965,6 +1970,7 @@ typedef enum fraction_subtypes {
# define radical_degree noad_extra_1
# define radical_left_delimiter noad_extra_2
# define radical_right_delimiter noad_extra_3
+# define radical_size noad_extra_4
# define radical_height noad_extra_5
# define radical_depth noad_extra_6
@@ -2513,9 +2519,10 @@ inline static void tex_attach_attribute_list_attribute(halfword target, halfword
# define attach_current_attribute_list tex_build_attribute_list /* (target) */
# define set_current_attribute_state(v) do { \
- current_attribute_state = v; \
+ current_attribute_state = v; \
} while (0)
+/*
# define change_attribute_register(a,id,value) do { \
if (eq_value(id) != value) { \
if (is_global(a)) { \
@@ -2532,6 +2539,9 @@ inline static void tex_attach_attribute_list_attribute(halfword target, halfword
set_current_attribute_state(attribute_cache_disabled); \
} \
} while (0)
+*/
+
+extern void tex_change_attribute_register(halfword a, halfword id, halfword value);
# define save_attribute_state_before() do { \
halfword c = current_attribute_state; \
@@ -2621,8 +2631,8 @@ typedef enum glue_signs {
# define normal_glue_multiplier 0.0
-inline halfword tex_checked_glue_sign (halfword sign) { return ((sign < min_glue_sign ) || (sign > max_glue_sign )) ? normal_glue_sign : sign ; }
-inline halfword tex_checked_glue_order (halfword order) { return ((order < min_glue_order) || (order > max_glue_order)) ? normal_glue_order : order; }
+inline static halfword tex_checked_glue_sign (halfword sign) { return ((sign < min_glue_sign ) || (sign > max_glue_sign )) ? normal_glue_sign : sign ; }
+inline static halfword tex_checked_glue_order (halfword order) { return ((order < min_glue_order) || (order > max_glue_order)) ? normal_glue_order : order; }
/*tex
These are reserved nodes that sit at the start of main memory. We could actually just allocate