Source

shakespeare-parrot / shakespeare.pir

Diff from to

shakespeare.pir

     # ignored
     .param pmc adverbs         :slurpy :named
     .local pmc rgx, stdin, match
-    .local pmc code # code has to be a pmc or a string conversion from null will die()
-    .local string output, prompt
+    .local string output, prompt, code
     prompt = '>'
     stdin = getstdin
     say "Thou hast entered the interactive sentence verifier"
     rgx= get_hll_global ['shakespeare';'Grammar'], 'sentence'
   loop: 
     unless stdin goto endloop
-    
-    code = stdin.'readline_interactive'(prompt)
-    if null code goto endloop
+    # need a pmc or a string conversion from null will die()
+    $P0 = stdin.'readline_interactive'(prompt)
+    if null $P0 goto endloop
+    code = $P0
     unless code goto loop
+    downcase code
     match = rgx(code)
     if match goto dump
     say "no match"