#reverse #backward #fun #macro #proc-macro

macro build gnal_tsur

.esrever ni edoc etirW

1 unstable release

0.1.0 Aug 21, 2023

#741 in Build Utils

MIT license

7KB
135 lines

gnal_tsur!

.esrever ni edoc etirW

Features

  • Reversed tokens.
  • Reversed identifiers and literals.

Usage

lang_rust!

This macro reverses the order of every token in the code provided to it.

Even though the character order of identifiers and literals are untouched, the characters of punctuations are considered separate and are therefore reversed as well.

fn fibonacci(n: u32) -> u32 {
	match n {
		0 => 1,
		1 => 1,
		_ => fibonacci(n - 1) + fibonacci(n - 2),
	}
}

lang_rust! {
	{
		{
			,(2 - n)fibonacci + (1 - n)fibonacci >= _
			,1 >= 1
			,1 >= 0
		} n match
	} u32 >- (u32 :n)fibonacci fn
}

gnal_tsur!

This macro is like lang_rust!, but it also reverses the order of characters in identifiers and literals.

fn fibonacci(n: u32) -> u32 {
	match n {
		0 => 1,
		1 => 1,
		_ => fibonacci(n - 1) + fibonacci(n - 2),
	}
}

gnal_tsur! {
	{
		{
			,(2 - n)iccanobif + (1 - n)iccanobif >= _
			,1 >= 1
			,1 >= 0
		} n hctam
	} 23u >- (23u :n)iccanobif nf
}

Dependencies

~215–650KB
~16K SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy