Welcome to my Code Snippets

MyCodeSnippets.Space

Preprocessor basics

ReAdABLE Source (What is the ReAdABLE Human Format?)

http://mycodesnippets.space/redlang/preprocessor/basics.red

Introduction

The Red preprocessor transforms code during, after the LOADing phase. Transformations are achieved by inlining preprocessor keywords (called directives) inside Red source code.

Demo

For demo type in Red Console:

do read http://mycodesnippets.space/redlang/preprocessor/src/basics.red

then type:

[1,2,3,abd,”hello”]

You should get this: https://i.imgur.com/wpGH6G1.png

Source code

https://i.imgur.com/NYKUJlk.png


system/lexer/pre-load: func [src part][
    parse src [
        any [
            remove comma insert #" " | skip
        ]
    ]
]
do {
    block: [1,2,3,abd,"hello"] 
    ?? block
}