Crate figure_skating_element_parser

Source
Expand description

§Figure Skating Element Parser Grammar

This documentation explains the rules and structure of the grammar used in the figure skating element parser.

§Rules

§WHITESPACE

This rule matches any whitespace characters (space, tab, newline).

WHITESPACE = _{ " " | "\t" | "\n" }

§DIGIT

This rule matches any numeric characters from 0 to 9.

DIGIT = { "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" }

§element

This main rule defines all possible figure skating elements that the parser can recognize. Each element type corresponds to a distinct category.

element = { jump | spin | step_sequence | death_spiral | pair_spin | twizzle | choreographic_element }

§jump

The rule for jumps, supporting various levels of difficulty, including single, double, triple, and quad jumps.

jump = { ("1" | "2" | "3" | "4") ~ jump_type ~ throw_jump? }

§jump_type:

Defines the type of jump (e.g., Toeloop, Salchow, Loop, Flip, Lutz, Axel).

jump_type = { "T" | "S" | "Lo" | "F" | "Lz" | "A" }

§throw_jump:

Indicates a “throw” jump (used in pairs skating).

throw_jump = { "Th" }

§spin

The rule for spins, including standard spins, flying spins, and change-foot spins.

spin = { (spin_position ~ "Sp") | flying_spin | flying_change_foot_spin }

§spin_position:

Specifies the spin position (e.g., Upright, Camel, Layback, Sit).

spin_position = { "U" | "L" | "C" | "S" }

§step_sequence

The rule for step sequences. These can be standard or choreographic step sequences.

step_sequence = { "StSq" | "ChSq" }

§death_spiral

The rule for death spirals. This includes forward and backward positions.

death_spiral = { death_spiral_position ~ "Ds" }

§death_spiral_position:

Defines the death spiral position (e.g., Forward Inside, Backward Outside).

death_spiral_position = { "Fi" | "Bi" | "Fo" | "Bo" }

§pair_spin

The rule for spins in pairs skating.

pair_spin = { "PSp" | "PCoSp" }

§twizzle

The rule for twizzles (rotational elements).

twizzle = { "STw" }

§choreographic_element

The rule for choreographic elements, including choreographic lifts and spins.

choreographic_element = { "ChLi1" | "ChSp1" }

Structs§

ElementParser
ParsedElement

Enums§

ParseError
Rule

Functions§

parse_elements