[][src]Module genco::lang::python

Specialization for Python code generation.

Examples

String quoting in Python:

use genco::prelude::*;

let toks: python::Tokens = quote!("hello \n world");
assert_eq!("\"hello \\n world\"", toks.to_string()?);

let toks: python::Tokens = quote!(#(quoted("hello \n world")));
assert_eq!("\"hello \\n world\"", toks.to_string()?);

Structs

Config

Configuration for python.

Format

Formatting state for python.

Import

The import of a Python name from module import foo.

ImportModule

The import of a Python module import module.

Python

Language specialization for Python.

Enums

Any

Enum produced by AsAny::as_any() which can be used to identify and operate over a discrete language item type.

Traits

AsAny

Language-specific conversion trait implemented by all language items.

Functions

import

Setup an imported item.

import_module

Setup an imported module.

Type Definitions

Tokens

Tokens container specialization for Python.