Module Expr Str Import alias ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore IfExp NameLoad Str Str Assign NameStore BoolOpOr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad If NameLoad body Return BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Return Return BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call NameLoad BinOpAdd NameLoad NameLoad SubscriptLoad NameLoad Index Str If NameLoad body Return BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return If Call AttributeLoad NameLoad attr NameLoad body Return Assign TupleStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num If Call NameLoad NameLoad body Return If CompareNotEq Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body Return Assign NameStore Call NameLoad NameLoad NameLoad Return BinOpMod Str TupleLoad NameLoad NameLoad BoolOpOr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Return TupleLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num orelse Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Return Assign NameStore IfExp NameLoad Str Str Return BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad If NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad NameLoad body Return NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareEq NameLoad Str body Return NameLoad If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Assign NameStore Str If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Assign NameStore Str If CompareEq NameLoad Str body If CompareEq NameLoad Str body Assign NameStore Str orelse Assign NameStore BoolOpOr NameLoad NameLoad Return BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return TupleLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad body Return NameLoad decorator_list
N/A N/A Expands things.

>>> expand_statement("m10m")
"margin: 10em"

>>> expand_statement("    m10m")
"    margin: 10em"

>>> expand_property("pad")
"padding:"
 N/A re definitions definitions indexer Indexer N/A index N/A Indexer N/A N/A N/A index index definitions N/A line_expr N/A N/A re compile ^(\s*)(.*?)$ N/A rule_expr N/A N/A re compile ^((?:[a-z]+-)*[a-z]+): *([^\s].*?);?$ N/A value_expr N/A N/A re compile ^([^\.\d-]*)(-?\d*\.?\d+)(x|p[tcx]?|e[mx]?|s|m[ms]?|rem|ch|v[wh]|vmin|max|%|)$ N/A semicolon_expr N/A N/A re compile ;\s*$ N/A selectorlike_expr N/A N/A re compile .*(link|visited|before|placeholder|root|after|focus|hover|active|checked|selected).* N/A ends_in_brace_expr N/A N/A re compile .*\{\s*$ expand_statement N/A N/A line usecolon N/A True N/A N/A Expands a statement line. Executed when pressing <Enter>.

        "db"          => "display: block"
        "m3m"         => "margin: 3em"
        "pad10"       => "padding: 10px"
        "margin: 3"   => "margin: 3px"
        "margin: 3px" => "margin: 3px"
        "margin:3px"  => "margin: 3px"
     N/A N/A indent snippet N/A split_indent line N/A separator N/A usecolon : N/A out N/A N/A expand_statement_simple snippet separator N/A expand_statement_with_property snippet separator N/A expand_statement_value snippet separator N/A out N/A N/A N/A indent out N/A expand_statement_simple N/A N/A snippet separator N/A N/A N/A Check if its a simple statement. (Internal)

        "db"  => "display: block"
     N/A options N/A N/A N/A index statements get snippet N/A N/A options N/A N/A N/A N/A %s%s %s N/A N/A options N/A property separator N/A options N/A value N/A expand_statement_with_property N/A N/A snippet separator N/A N/A N/A Expands a statement with both shorthand property and value. (Internal)

        "m10em"  => "margin: 10em"
        "pad10"  => "padding: 10px"
     N/A N/A short value unit N/A split_value snippet N/A options N/A N/A N/A index properties get short N/A N/A options N/A N/A N/A xvalue N/A expand_full_value N/A value unit N/A options N/A property N/A xvalue N/A N/A N/A %s%s %s N/A N/A options N/A property separator xvalue N/A expand_statement_value N/A N/A snippet separator N/A N/A N/A Expands a statement's unit value. (Internal)

        "margin: 3"    => "margin: 3px"
        "margin: 3px"  => "margin: 3px"
        "margin:3px"   => "margin: 3px"

    skip it if it's say 'p:before' or anything selector-like.
    this will also return the same thing for "complete" rules
    (eg: "margin: auto"), thereby adding semicolons to them.
     N/A m N/A N/A rule_expr match snippet N/A N/A m N/A N/A N/A N/A N/A semicolon_expr match snippet N/A N/A N/A N/A prop value N/A N/A N/A m group 1 N/A N/A m group 2 N/A N/A is_selectorlike value N/A N/A N/A N/A N/A N/A value count ( N/A N/A value count ) N/A N/A N/A new_value N/A expand_full_value value prop N/A N/A %s%s %s N/A prop separator N/A new_value value N/A split_value N/A N/A snippet N/A N/A N/A Splits a snippet into `property`, `number` and `unit`. Property and unit
    are optional.

        # margin: 10px
        "m10p" => ("m", "10", "p")
        "10p"  => ("", "10", "p")
        "10"   => ("", "10", "")
        "??"   => (None, None, None)
     N/A m N/A N/A value_expr match snippet N/A m N/A N/A N/A N/A N/A m group 1 N/A N/A m group 2 N/A N/A m group 3 N/A N/A N/A None None None N/A expand_property N/A N/A line usecolon N/A True N/A N/A Expands a property. Used to expand on `:` or ` `.

    >>> expand_property("m")
    "margin:"
     N/A N/A indent snippet N/A split_indent line N/A options N/A N/A N/A index properties get snippet N/A N/A options N/A N/A N/A separator N/A usecolon : N/A N/A %s%s%s N/A indent N/A options N/A property separator N/A expand_full_value N/A N/A val prop N/A N/A N/A Expands a value of a given property `prop`. Returns the expanded value.

        e("3", "margin")  => "3px"
        e("3x", "margin") => "3px"
        e("a", "margin")  => "auto"
        e("l", "float")   => "left"
     N/A options N/A N/A N/A index full_properties get prop N/A N/A options N/A N/A N/A default_unit N/A N/A options get unit N/A default_unit N/A N/A N/A _ number unit N/A split_value val N/A number N/A N/A N/A unitify number unit default_unit N/A values N/A N/A options get values N/A values N/A N/A N/A match_keyword val values N/A match_keyword N/A N/A value keywords N/A N/A N/A Finds the closest match to a `value` given a list of `keywords`.

    >>> match_keyword('l', ['left', 'right', 'auto'])
    "left"

    >>> match_keyword('xxx', ['inherit', 'auto'])
    None
     N/A word keywords N/A N/A N/A N/A re match N/A ^ value word N/A N/A word N/A word keywords N/A N/A N/A N/A re match value word N/A N/A word N/A unitify N/A N/A number unit default_unit N/A N/A N/A Expands a single `number` + `unit` value. If the unit is absent (blank
    string), the `default_unit` will be used instead.

        ("10", "", "px")  => "10px"
        ("10", "m")       => "10em"
     N/A N/A number 0 N/A N/A number N/A N/A N/A unit p N/A unit x N/A N/A unit px N/A N/A N/A unit m N/A unit e N/A N/A unit em N/A N/A unit N/A N/A N/A default_unit _ N/A N/A unit N/A N/A unit N/A default_unit px N/A N/A number unit N/A split_indent N/A N/A line N/A N/A N/A (Private) splits a line into its indentation and meat.

    >>> (indent, snippet) = split_indent("  db")
    ("  ", "db")
     N/A match N/A N/A line_expr match line N/A N/A N/A N/A match group 1 N/A N/A match group 2 N/A is_selectorlike N/A N/A value N/A N/A N/A Checks if a line looks like a selector. This is used to prevent
    expansion on things that seem like rules, but are actually selectors.

        "pad:10"    => False
        "p:10"      => False
        "p:before"  => True
     N/A N/A N/A N/A selectorlike_expr match value N/A N/A ends_in_brace_expr match value N/A N/A True N/A