dymokomi/luce-browser-css
Source of release 0.5.1
0.5.1 / src / css_data / generated_descriptor_id.lucb
#==============================================================================================
#
# generated_descriptor_id - the CSS at-rules and their descriptors
#
# DESCRIPTION:
# Generated by tools/gen_css from data/css; do not edit. The C++ it stands for, at
# Ladybird 47c82b38d0, is written by Meta/Generators/generate_libweb_css_descriptors.py
# from Descriptors.json:
#
# Build/Libraries/LibWeb/CSS/DescriptorID.h
# Build/Libraries/LibWeb/CSS/DescriptorID.cpp
#
# descriptor_initial_value(), which parses style values, is the engine's.
#
# Copyright (c) 2018-2026, the Ladybird developers.
# Copyright (c) 2026 the luce-browser authors.
# SPDX-License-Identifier: BSD-2-Clause (see LICENSE)
#
#==============================================================================================
## Web::CSS::AtRuleID (Build/Libraries/LibWeb/CSS/DescriptorID.h).
pub enum AtRuleId as u8:
font_face = 0
page = 1
property = 2
counter_style = 3
function = 4
## Web::CSS::DescriptorID (Build/Libraries/LibWeb/CSS/DescriptorID.h).
pub enum DescriptorId as u8:
additive_symbols = 0
ascent_override = 1
bleed = 2
descent_override = 3
fallback = 4
font_display = 5
font_family = 6
font_feature_settings = 7
font_language_override = 8
font_named_instance = 9
font_style = 10
font_variation_settings = 11
font_weight = 12
font_width = 13
inherits = 14
initial_value = 15
line_gap_override = 16
margin = 17
margin_bottom = 18
margin_left = 19
margin_right = 20
margin_top = 21
marks = 22
negative = 23
pad_ = 24
page_orientation = 25
prefix = 26
range = 27
result = 28
size = 29
speak_as = 30
src = 31
suffix = 32
symbols = 33
syntax = 34
system = 35
unicode_range = 36
custom = 37
# mark: DescriptorMetadata ======================================================================
## Web::CSS::DescriptorMetadata (Build/Libraries/LibWeb/CSS/DescriptorID.h).
pub struct DescriptorMetadata:
pub var syntax: ak.Vector[KeywordOrPropertyIdOrDescriptorMetadataValueType]
pub var allow_arbitrary_substitution_functions: bool # C++ default: { false }
## Web::CSS::DescriptorMetadata::ValueType (Build/Libraries/LibWeb/CSS/DescriptorID.h).
pub enum DescriptorMetadataValueType as i32:
counter_style_system = 0
counter_style_additive_symbols = 1
counter_style_name = 2
counter_style_negative = 3
counter_style_pad = 4
counter_style_range = 5
crop_or_cross = 6
family_name = 7
font_src_list = 8
font_weight_absolute_pair = 9
length = 10
optional_declaration_value = 11
page_size = 12
positive_percentage = 13
string = 14
symbol = 15
symbols = 16
unicode_range_tokens = 17
# mark: DescriptorID.cpp ========================================================================
## Ported from Build/Libraries/LibWeb/CSS/DescriptorID.cpp Web::CSS::to_string(AtRuleID).
pub func to_string_at_rule_id(at_rule_id: AtRuleId) -> ak.FlyString:
match at_rule_id:
.font_face: return ak.fly_string_from_str("@font-face")
.page: return ak.fly_string_from_str("@page")
.property: return ak.fly_string_from_str("@property")
.counter_style: return ak.fly_string_from_str("@counter-style")
.function: return ak.fly_string_from_str("@function")
_: trap("VERIFY_NOT_REACHED")
## Ported from Build/Libraries/LibWeb/CSS/DescriptorID.cpp Web::CSS::descriptor_id_from_string.
pub func descriptor_id_from_string(at_rule_id: AtRuleId, string: ak.StringView) -> DescriptorId?:
match at_rule_id:
.font_face:
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("ascent-override")):
return DescriptorId.ascent_override
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("descent-override")):
return DescriptorId.descent_override
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-display")):
return DescriptorId.font_display
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-family")):
return DescriptorId.font_family
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-feature-settings")):
return DescriptorId.font_feature_settings
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-language-override")):
return DescriptorId.font_language_override
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-named-instance")):
return DescriptorId.font_named_instance
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-stretch")):
return DescriptorId.font_width
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-style")):
return DescriptorId.font_style
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-variation-settings")):
return DescriptorId.font_variation_settings
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-weight")):
return DescriptorId.font_weight
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("font-width")):
return DescriptorId.font_width
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("line-gap-override")):
return DescriptorId.line_gap_override
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("src")):
return DescriptorId.src
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("unicode-range")):
return DescriptorId.unicode_range
.page:
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("bleed")):
return DescriptorId.bleed
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("margin")):
return DescriptorId.margin
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("margin-bottom")):
return DescriptorId.margin_bottom
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("margin-left")):
return DescriptorId.margin_left
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("margin-right")):
return DescriptorId.margin_right
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("margin-top")):
return DescriptorId.margin_top
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("marks")):
return DescriptorId.marks
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("page-orientation")):
return DescriptorId.page_orientation
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("size")):
return DescriptorId.size
.property:
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("inherits")):
return DescriptorId.inherits
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("initial-value")):
return DescriptorId.initial_value
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("syntax")):
return DescriptorId.syntax
.counter_style:
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("system")):
return DescriptorId.system
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("negative")):
return DescriptorId.negative
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("prefix")):
return DescriptorId.prefix
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("suffix")):
return DescriptorId.suffix
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("range")):
return DescriptorId.range
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("pad")):
return DescriptorId.pad_
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("fallback")):
return DescriptorId.fallback
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("symbols")):
return DescriptorId.symbols
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("additive-symbols")):
return DescriptorId.additive_symbols
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("speak-as")):
return DescriptorId.speak_as
.function:
if is_a_custom_property_name_string(string):
return DescriptorId.custom
if ak.string_view_equals_ignoring_ascii_case(&string, ak.sv("result")):
return DescriptorId.result
_: return none
return none
## Ported from Build/Libraries/LibWeb/CSS/DescriptorID.cpp Web::CSS::to_string(DescriptorID).
pub func to_string_descriptor_id(descriptor_id: DescriptorId) -> ak.FlyString:
match descriptor_id:
.additive_symbols: return ak.fly_string_from_str("additive-symbols")
.ascent_override: return ak.fly_string_from_str("ascent-override")
.bleed: return ak.fly_string_from_str("bleed")
.descent_override: return ak.fly_string_from_str("descent-override")
.fallback: return ak.fly_string_from_str("fallback")
.font_display: return ak.fly_string_from_str("font-display")
.font_family: return ak.fly_string_from_str("font-family")
.font_feature_settings: return ak.fly_string_from_str("font-feature-settings")
.font_language_override: return ak.fly_string_from_str("font-language-override")
.font_named_instance: return ak.fly_string_from_str("font-named-instance")
.font_style: return ak.fly_string_from_str("font-style")
.font_variation_settings: return ak.fly_string_from_str("font-variation-settings")
.font_weight: return ak.fly_string_from_str("font-weight")
.font_width: return ak.fly_string_from_str("font-width")
.inherits: return ak.fly_string_from_str("inherits")
.initial_value: return ak.fly_string_from_str("initial-value")
.line_gap_override: return ak.fly_string_from_str("line-gap-override")
.margin: return ak.fly_string_from_str("margin")
.margin_bottom: return ak.fly_string_from_str("margin-bottom")
.margin_left: return ak.fly_string_from_str("margin-left")
.margin_right: return ak.fly_string_from_str("margin-right")
.margin_top: return ak.fly_string_from_str("margin-top")
.marks: return ak.fly_string_from_str("marks")
.negative: return ak.fly_string_from_str("negative")
.pad_: return ak.fly_string_from_str("pad")
.page_orientation: return ak.fly_string_from_str("page-orientation")
.prefix: return ak.fly_string_from_str("prefix")
.range: return ak.fly_string_from_str("range")
.result: return ak.fly_string_from_str("result")
.size: return ak.fly_string_from_str("size")
.speak_as: return ak.fly_string_from_str("speak-as")
.src: return ak.fly_string_from_str("src")
.suffix: return ak.fly_string_from_str("suffix")
.symbols: return ak.fly_string_from_str("symbols")
.syntax: return ak.fly_string_from_str("syntax")
.system: return ak.fly_string_from_str("system")
.unicode_range: return ak.fly_string_from_str("unicode-range")
.custom: trap("VERIFY_NOT_REACHED")
_: trap("VERIFY_NOT_REACHED")
## Ported from Build/Libraries/LibWeb/CSS/DescriptorID.cpp Web::CSS::at_rule_supports_descriptor.
pub func at_rule_supports_descriptor(at_rule_id: AtRuleId, descriptor_id: DescriptorId) -> bool:
match at_rule_id:
.font_face:
match descriptor_id:
.ascent_override: return true
.descent_override: return true
.font_display: return true
.font_family: return true
.font_feature_settings: return true
.font_language_override: return true
.font_named_instance: return true
.font_style: return true
.font_variation_settings: return true
.font_weight: return true
.font_width: return true
.line_gap_override: return true
.src: return true
.unicode_range: return true
_: return false
.page:
match descriptor_id:
.bleed: return true
.margin: return true
.margin_bottom: return true
.margin_left: return true
.margin_right: return true
.margin_top: return true
.marks: return true
.page_orientation: return true
.size: return true
_: return false
.property:
match descriptor_id:
.inherits: return true
.initial_value: return true
.syntax: return true
_: return false
.counter_style:
match descriptor_id:
.system: return true
.negative: return true
.prefix: return true
.suffix: return true
.range: return true
.pad_: return true
.fallback: return true
.symbols: return true
.additive_symbols: return true
.speak_as: return true
_: return false
.function:
match descriptor_id:
.result: return true
.custom: return true
_: return false
_: trap("VERIFY_NOT_REACHED")
## Ported from Build/Libraries/LibWeb/CSS/DescriptorID.cpp Web::CSS::get_descriptor_metadata.
pub func get_descriptor_metadata(at_rule_id: AtRuleId, descriptor_id: DescriptorId) -> DescriptorMetadata:
match at_rule_id:
.font_face:
match descriptor_id:
.ascent_override:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.normal))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.positive_percentage))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.descent_override:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.normal))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.positive_percentage))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_display:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.block))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.swap))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.fallback))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.optional))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_family:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.family_name))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_feature_settings:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.font_feature_settings))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_language_override:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.normal))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.string))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_named_instance:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.string))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_style:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.font_style))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_variation_settings:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.font_variation_settings))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_weight:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.font_weight_absolute_pair))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.font_width:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.font_width))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.line_gap_override:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.normal))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.positive_percentage))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.src:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.font_src_list))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.unicode_range:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.unicode_range_tokens))
metadata.allow_arbitrary_substitution_functions = false
return metadata
_: trap("VERIFY_NOT_REACHED")
.page:
match descriptor_id:
.bleed:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.length))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.margin:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.margin))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.margin_bottom:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.margin_bottom))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.margin_left:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.margin_left))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.margin_right:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.margin_right))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.margin_top:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.property_id(value = PropertyId.margin_top))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.marks:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.none_))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.crop_or_cross))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.page_orientation:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.upright))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.rotate_left))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.rotate_right))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.size:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.page_size))
metadata.allow_arbitrary_substitution_functions = false
return metadata
_: trap("VERIFY_NOT_REACHED")
.property:
match descriptor_id:
.inherits:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.true_))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.false_))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.initial_value:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.optional_declaration_value))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.syntax:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.string))
metadata.allow_arbitrary_substitution_functions = false
return metadata
_: trap("VERIFY_NOT_REACHED")
.counter_style:
match descriptor_id:
.system:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_system))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.negative:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_negative))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.prefix:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.symbol))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.suffix:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.symbol))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.range:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_range))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.pad_:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_pad))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.fallback:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_name))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.symbols:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.symbols))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.additive_symbols:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_additive_symbols))
metadata.allow_arbitrary_substitution_functions = false
return metadata
.speak_as:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.auto))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.bullets))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.numbers))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.words))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.keyword(value = Keyword.spell_out))
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.counter_style_name))
metadata.allow_arbitrary_substitution_functions = false
return metadata
_: trap("VERIFY_NOT_REACHED")
.function:
match descriptor_id:
.result:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.optional_declaration_value))
metadata.allow_arbitrary_substitution_functions = true
return metadata
.custom:
var metadata = DescriptorMetadata()
ak.vector_append_t(&metadata.syntax, KeywordOrPropertyIdOrDescriptorMetadataValueType.descriptor_metadata_value_type(value = DescriptorMetadataValueType.optional_declaration_value))
metadata.allow_arbitrary_substitution_functions = true
return metadata
_: trap("VERIFY_NOT_REACHED")
_: trap("VERIFY_NOT_REACHED")