-
Notifications
You must be signed in to change notification settings - Fork 2
Syntax
Pepe syntax is simple - it's possible to parse it with a regular expression that doesn't even span more than 15 characters. Here is an example, where every command is captured to group 1 - note that it doesn't handle spaces in the middle of the word correctly…
Let's start from the basics:
Pepe is case-sensitive. RE
and re
are 2 completely different things!
In Pepe, everything that is not in REre
is ignored, so we can call it a comment.
This is a commnt.
However, because it takes a bit of time to remove all op's and some words might be unreadable, we can use the second type of comments:
# Everything following a "#" per line is a comment.
ReEeEeE # Comments end with a line break.
After removing all the comments, Pepe will parse all commands. A command starts with either R
or r
and consists of every E
and e
before the next command.
1 2
REEE r e e # comment in middle of command
3 4
e e re re
In the above example, there are 4 commands. REEE
, reeee
and two re
s. Note that all spaces are ignored, since they're comments too.
- The first
R
orr
defines the stack the command works on. Pepe has two, with names corresponding to the used letter:R
andr
. - The following
E
's ande
's tell Pepe what command from the list it is.
Examples:
-
REEE
- Auto parse input and push it to stackR
. -
Re
- Pop item from stackR
. -
rEeeEE
- Square active item in stackr
.
In Pepe, every command starts with R
or r
and contains at least one E
or e
. If it does not meet one of the criteria, it's a flag.
Examples (uppercase = flag):
EEEEreee
RRreee
EEERRreee
reee reee Rreeee
EEE ree Rreee RRreeee