Pep and Nom

home | documentation | examples | translators | download | blog | all blog posts

the ℕ𝕠𝕞 "while" command

Read the input stream while the peep register contains the given character class

The 'while' command in the pattern-parse language reads the input stream while the ℙ𝕖𝕡 virtual machine peep buffer is any one of the characters or character sets mentioned in the argument. The command is written

an example while command
 while [cdef];

The command takes one argument. This argument may also include character classes as well as literal characters. From example,

 while [:space:];

reads the input stream while the peep buffer is a digit. The read characters are appended to the 'workspace' buffer. The while command cannot take a quoted argument ("xxx").

Negation for the character class is currently supported using the whilenot command.

todo:

allow the syntax while ![:space:]; which will just get translated into whilenot [:space:];