Commits

gabriele renzi  committed 615dbce

support extended values for 2nd p and be

  • Participants
  • Parent commits 51ad380

Comments (0)

Files changed (3)

File src/parser/actions.pm

   make $past;
 }
 
-method exits($/) {
+method exeunts($/) {
   my $past := PAST::Stmts.new();
 
   for $<charlist><character> {
   }
   make $past;
 }
+method exits($/) {
+  my $res := mkcall( PAST::Val.new(
+      :value($<character>), 
+      :returns('String'),
+      ),'exit' );
+  make $res;
+}
 
 method immediate($/) {
   my $value := 1;

File src/parser/grammar.pg

 rule events {
   | <line> {*}   #= line
   | <enters> {*} #= enters
-  | <exits> {*}  #= exits
+  | <exeunts> {*}  #= exeunts
+  | <exits> {*}  #= exeunts
 }
 
 rule chardef {
   'plan' <value> {*}
 }
 
-token io {
-  |'open your heart'      {*} #= open_heart
-  |'speak your mind'      {*} #= speak_mind
-  |'listen to your heart' {*} #= listen_heart
-  |'open your mind'       {*} #= open_mind
+rule io {
+  |'open' <second_person_possessive> 'heart'      {*} #= open_heart
+  |'speak' <second_person_possessive> 'mind'      {*} #= speak_mind
+  |'listen' 'to' <second_person_possessive> 'heart' {*} #= listen_heart
+  |'open' <second_person_possessive> 'mind'       {*} #= open_mind
 }
 
 rule assignment {
   [
-  | 'you' 'are' 'as' <adjective> 'as' <value> 
-  | 'you' 'are' <value>
-  | 'you' <value>
+  |<second_person> <be> 'as' <adjective> 'as' <value> 
+  |<second_person> <be> <value>
+  |<second_person> <value>
   ]
   {*}
 }
   'enter' <charlist> {*} 
  ']'
 }
+rule exeunts {
+ '[' 
+  'exeunt' <charlist> {*} 
+ ']'
+}
+
 rule exits {
  '[' 
-  'exeunt' <charlist> {*} 
+  'exit' <character> {*} 
  ']'
 }
 token description {

File src/parser/words.pg

  |'misused'
  |'oozing'
  |'rotten'
- |'rotten'
  |'smelly'
  |'snotty'
  |'sorry'
  |'rich'
  |'smooth'
  |'sunny'
+ |'sweetest'
  |'sweet'
- |'sweetest'
  |'trustworthy'
  |'warm'
 }