Exemplo n.º 1
0
 void LookupChar(Frame frame, string name, ConsumeChar consume)
 {
     LookupString(frame, name, str => {
         if (str.Length == 1 || str.Length == 2 && Char.IsSurrogatePair(str, 0))
         {
             consume(Char.ConvertToUtf32(str, 0));
         }
         else
         {
             task_master.ReportOtherError(source_ref, String.Format("String “{0}” for “{1}” must be a single codepoint.", str, name));
         }
     });
 }
Exemplo n.º 2
0
 void LookupChar(Frame frame, string name, ConsumeChar consume)
 {
     LookupString(frame, name, str => {
         if (str.Length == 1 || str.Length == 2 && Char.IsSurrogatePair(str, 0)) {
             consume(Char.ConvertToUtf32(str, 0));
         } else {
             task_master.ReportOtherError(source_ref, String.Format("String “{0}” for “{1}” must be a single codepoint.", str, name));
         }
     });
 }