Struct ReadableLuaGenerator

Source
pub struct ReadableLuaGenerator { /* private fields */ }
Expand description

This implementation of LuaGenerator attempts to produce Lua code as readable as possible.

Implementations§

Source§

impl ReadableLuaGenerator

Source

pub fn new(column_span: usize) -> Self

Trait Implementations§

Source§

impl Clone for ReadableLuaGenerator

Source§

fn clone(&self) -> ReadableLuaGenerator

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReadableLuaGenerator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReadableLuaGenerator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl LuaGenerator for ReadableLuaGenerator

Source§

fn into_string(self) -> String

Consumes the LuaGenerator and produce a String object.
Source§

fn write_block(&mut self, block: &Block)

Source§

fn write_last_statement(&mut self, statement: &LastStatement)

Source§

fn write_assign_statement(&mut self, assign: &AssignStatement)

Source§

fn write_local_assign(&mut self, assign: &LocalAssignStatement)

Source§

fn write_compound_assign(&mut self, assign: &CompoundAssignStatement)

Source§

fn write_local_function(&mut self, function: &LocalFunctionStatement)

Source§

fn write_generic_for(&mut self, generic_for: &GenericForStatement)

Source§

fn write_numeric_for(&mut self, numeric_for: &NumericForStatement)

Source§

fn write_if_statement(&mut self, if_statement: &IfStatement)

Source§

fn write_function_statement(&mut self, function: &FunctionStatement)

Source§

fn write_do_statement(&mut self, do_statement: &DoStatement)

Source§

fn write_repeat_statement(&mut self, repeat: &RepeatStatement)

Source§

fn write_while_statement(&mut self, while_statement: &WhileStatement)

Source§

fn write_type_declaration_statement( &mut self, statement: &TypeDeclarationStatement, )

Source§

fn write_false_expression(&mut self, _token: &Option<Token>)

Source§

fn write_true_expression(&mut self, _token: &Option<Token>)

Source§

fn write_nil_expression(&mut self, _token: &Option<Token>)

Source§

fn write_variable_arguments_expression(&mut self, _token: &Option<Token>)

Source§

fn write_binary_expression(&mut self, binary: &BinaryExpression)

Source§

fn write_unary_expression(&mut self, unary: &UnaryExpression)

Source§

fn write_function(&mut self, function: &FunctionExpression)

Source§

fn write_function_call(&mut self, call: &FunctionCall)

Source§

fn write_tuple_arguments(&mut self, arguments: &TupleArguments)

Source§

fn write_field(&mut self, field: &FieldExpression)

Source§

fn write_index(&mut self, index: &IndexExpression)

Source§

fn write_if_expression(&mut self, if_expression: &IfExpression)

Source§

fn write_table(&mut self, table: &TableExpression)

Source§

fn write_table_entry(&mut self, entry: &TableEntry)

Source§

fn write_number(&mut self, number: &NumberExpression)

Source§

fn write_string(&mut self, string: &StringExpression)

Source§

fn write_interpolated_string( &mut self, interpolated_string: &InterpolatedStringExpression, )

Source§

fn write_identifier(&mut self, identifier: &Identifier)

Source§

fn write_parenthese(&mut self, parenthese: &ParentheseExpression)

Source§

fn write_type_cast(&mut self, type_cast: &TypeCastExpression)

Source§

fn write_type_name(&mut self, type_name: &TypeName)

Source§

fn write_type_field(&mut self, type_field: &TypeField)

Source§

fn write_true_type(&mut self, _: &Option<Token>)

Source§

fn write_false_type(&mut self, _: &Option<Token>)

Source§

fn write_nil_type(&mut self, _: &Option<Token>)

Source§

fn write_string_type(&mut self, string_type: &StringType)

Source§

fn write_array_type(&mut self, array: &ArrayType)

Source§

fn write_table_type(&mut self, table_type: &TableType)

Source§

fn write_expression_type(&mut self, expression_type: &ExpressionType)

Source§

fn write_parenthese_type(&mut self, parenthese_type: &ParentheseType)

Source§

fn write_function_type(&mut self, function_type: &FunctionType)

Source§

fn write_optional_type(&mut self, optional: &OptionalType)

Source§

fn write_intersection_type(&mut self, intersection: &IntersectionType)

Source§

fn write_union_type(&mut self, union: &UnionType)

Source§

fn write_type_pack(&mut self, type_pack: &TypePack)

Source§

fn write_variadic_type_pack(&mut self, variadic_type_pack: &VariadicTypePack)

Source§

fn write_generic_type_pack(&mut self, generic_type_pack: &GenericTypePack)

Source§

fn write_statement(&mut self, statement: &Statement)

Source§

fn write_variable(&mut self, variable: &Variable)

Source§

fn write_expression(&mut self, expression: &Expression)

Source§

fn write_prefix(&mut self, prefix: &Prefix)

Source§

fn write_arguments(&mut self, arguments: &Arguments)

Source§

fn write_type(&mut self, type: &Type)

Source§

fn write_function_return_type(&mut self, return_type: &FunctionReturnType)

Source§

fn write_variadic_argument_type( &mut self, variadic_argument_type: &VariadicArgumentType, )

Source§

fn write_function_variadic_type(&mut self, variadic_type: &FunctionVariadicType)

Source§

fn write_type_parameter(&mut self, type_parameter: &TypeParameter)

Source§

fn write_generic_type_pack_default( &mut self, generic_type_pack_default: &GenericTypePackDefault, )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<I, T> ExtractContext<I, ()> for T

Source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<I> RecreateContext<I> for I

Source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.