<s> import Test <EOL> import os <EOL> import sys <EOL> import Plex <EOL> from Plex import * <EOL> letter = Range ( "<STR_LIT>" ) | Any ( "<STR_LIT:_>" ) <EOL> digit = Range ( "<STR_LIT>" ) <EOL> space = Any ( "<STR_LIT>" ) <EOL> ident = letter + Rep ( letter | digit ) <EOL> resword = Str ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:type>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT:to>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:object>" ) <EOL> number = Rep1 ( digit ) <EOL> string = Str ( "<STR_LIT:'>" ) + ( Rep ( AnyBut ( "<STR_LIT:'>" ) ) | Str ( "<STR_LIT>" ) ) + Str ( "<STR_LIT:'>" ) <EOL> diphthong = Str ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:..>" ) <EOL> punct = Any ( "<STR_LIT>" ) <EOL> spaces = Rep1 ( space ) <EOL> comment_begin = Str ( "<STR_LIT:{>" ) <EOL> comment_char = AnyBut ( "<STR_LIT:}>" ) <EOL> comment_end = Str ( "<STR_LIT:}>" ) <EOL> lex = Lexicon ( [ <EOL> ( resword , TEXT ) , <EOL> ( ident , '<STR_LIT>' ) , <EOL> ( number , '<STR_LIT>' ) , <EOL> ( string , '<STR_LIT:str>' ) , <EOL> ( punct | diphthong , TEXT ) , <EOL> ( spaces , IGNORE ) , <EOL> ( comment_begin , Begin ( '<STR_LIT>' ) ) , <EOL> State ( '<STR_LIT>' , [ <EOL> ( comment_char , IGNORE ) , <EOL> ( comment_end , Begin ( '<STR_LIT>' ) ) <EOL> ] ) <EOL> ] , <EOL> debug = Test . debug , <EOL> timings = sys . stderr <EOL> ) <EOL> Test . run ( lex , "<STR_LIT>" , debug = <NUM_LIT:0> , trace = <NUM_LIT:0> ) </s>
