Pypass
ASnake Documentation
Summary:
PyPass is syntax for selecting a piece of Python code and skipping the ASnake compiler doing processing on it. The code will be passed onto the final Python file, and thus it must follow Python syntax and not ASnake syntax.
The usual use-case for this is for getting around ASnake bugs or the compiler optimizing code that you don't want touched. If you have to do this, it probably means you should tell the compiler developer(s) about it on Discord, or Github.
The more ideal use-case would be passing Cython syntax for when you are targeting Cython instead of Python, as ASnake does not support Cython syntax; but you may still want to use ASnake along-side Cython.
Occasionally PyPass can also be used to speed up compilation times, particularly on large lists or dicts.
In any case, be careful when using PyPass, as it increases the chance code is generated incorrectly, and thus could lead to an error of some sort.
p!print('this code is pypassed!')!p:
The syntax starts with a p!
. Then after you can type any Python code you want ignored by the compiler. Once finished, end with a !p
to close it.
p!print('this code is pypassed!')!p
# result: this code is pypassed!
PyPass also inherits indent, so it starting an indent shouldn't cause an IndentError unless the inside PyPass code adds extra spaces/tabs.
if True do
p!print('indents!')!p
# result: indents!
Multi-line PyPass is also supported, in the cases you would like to insert large pieces of Python code without worrying about ASnake syntax.
p!
x = 1+1
print(x*2)
!p
# result: 4