Ejemplo n.º 1
0
def all_strings() -> Tuple[BuiltinSymbol, ...]:
    return (
        BuiltinSymbol(
            OS_LINE_SEP,
            ValueType.STRING,
            string_sdvs.str_constant(os.linesep),
            CustomSymbolDocumentation(
                "The {plain_string} that separates text lines on the {current_os} ({NL}, {WIN_LINE_SEP}, e.g.)."
                .format(
                    NL=misc_texts.NEW_LINE_STRING_CONSTANT,
                    WIN_LINE_SEP=formatting.string_constant('\\r\\n'),
                    current_os=misc_texts.CURRENT_OS,
                    plain_string=misc_texts.PLAIN_STRING,
                ),
                SectionContents.empty(),
            ),
        ),
        BuiltinSymbol(
            NEW_LINE,
            ValueType.STRING,
            string_sdvs.str_constant('\n'),
            CustomSymbolDocumentation(
                "The new-line character ({NL}), the line separator of {string:s} handled by {program_name}"
                .format(
                    NL=misc_texts.NEW_LINE_STRING_CONSTANT,
                    string=types.STRING_TYPE_INFO.name,
                    program_name=program_info.PROGRAM_NAME.capitalize(),
                ),
                _TP.section_contents(_NEW_LINE_DESCRIPTION),
            ),
        ),
        BuiltinSymbol(
            TAB,
            ValueType.STRING,
            string_sdvs.str_constant('\t'),
            CustomSymbolDocumentation(
                'The tab character.',
                SectionContents.empty(),
            ),
        ),
    )
Ejemplo n.º 2
0
 def __init__(
     self,
     name_and_cross_ref_target: TypeNameAndCrossReferenceId,
     corresponding_syntax_element: SyntaxElementInfo,
     main_description_rest: SectionContents = SectionContents.empty(),
     custom_see_also_targets: Iterable[SeeAlsoTarget] = (),
     syntax_elements: Sequence[SyntaxElementDescription] = ()):
     super().__init__(name_and_cross_ref_target)
     self._name_and_cross_ref_target = name_and_cross_ref_target
     self._type_identifier = name_and_cross_ref_target.identifier
     self._corresponding_syntax_element = corresponding_syntax_element
     self._main_description_rest = main_description_rest
     self._custom_see_also_targets = list(custom_see_also_targets)
     self._syntax_elements = syntax_elements
Ejemplo n.º 3
0
def syntax_element_documentation(
    type_category: Optional[TypeCategory],
    name_and_cross_ref_target: SingularNameAndCrossReferenceId,
    main_description_rest: Sequence[ParagraphItem],
    main_description_rest_sub_sections: Sequence[SectionItem],
    invokation_variants: List[InvokationVariant],
    syntax_element_descriptions: List[SyntaxElementDescription],
    see_also_targets: List[SeeAlsoTarget],
    notes: SectionContents = SectionContents.empty(),
) -> SyntaxElementDocumentation:
    return SyntaxElementDocumentationWithConstantValues(
        type_category, name_and_cross_ref_target, main_description_rest,
        main_description_rest_sub_sections, notes, invokation_variants,
        syntax_element_descriptions, see_also_targets)
Ejemplo n.º 4
0
 def notes(self) -> SectionContents:
     return SectionContents.empty()
Ejemplo n.º 5
0
LINE_MATCHER_DOCUMENTATION = TypeDocumentation(
    types.LINE_MATCHER_TYPE_INFO,
    syntax_elements.LINE_MATCHER_SYNTAX_ELEMENT,
    _TP.section_contents(_LINE_MATCHER_DESCRIPTION),
)

FILE_MATCHER_DOCUMENTATION = TypeDocumentation(
    types.FILE_MATCHER_TYPE_INFO,
    syntax_elements.FILE_MATCHER_SYNTAX_ELEMENT,
)

STRING_TRANSFORMER_DOCUMENTATION = TypeDocumentation(
    types.STRING_TRANSFORMER_TYPE_INFO,
    syntax_elements.STRING_TRANSFORMER_SYNTAX_ELEMENT,
    SectionContents.empty(),
    (),
)

STRING_MATCHER_DOCUMENTATION = TypeDocumentation(
    types.STRING_MATCHER_TYPE_INFO,
    syntax_elements.STRING_MATCHER_SYNTAX_ELEMENT,
    SectionContents.empty(),
    (),
)

FILES_MATCHER_DOCUMENTATION = TypeDocumentation(
    types.FILES_MATCHER_TYPE_INFO,
    syntax_elements.FILES_MATCHER_SYNTAX_ELEMENT,
)
Ejemplo n.º 6
0
 def outcome(self) -> SectionContents:
     return SectionContents.empty()