View/Edit #35:scan_token

Switch to edit mode.

Name(s): scan_token
1:  caller == this || raise(E_PERM)
2:  string = this.input_string
3:  len = this.input_length
4:  i = this.input_index
5:  while (i <= len && string[i] == " ")
6:    i = i + 1
7:  endwhile
8:  if (i > len)
9:    return ""
10: elseif ((ch = string[i]) in {"(", ")", "!", "?", "^"})
11:   this.input_index = i + 1
12:   return ch
13: elseif (ch in {"&", "|"})
14:   this.input_index = i = i + 1
15:   if (i <= len && string[i] == ch)
16:     this.input_index = i + 1
17:   endif
18:   return ch + ch
19: else
20:   start = i
21:   while (i <= len && !((ch = string[i]) in {"(", ")", "!", "?", "&", "|", "^"}))
22:     i = i + 1
23:   endwhile
24:   this.input_index = i
25:   i = i - 1
26:   while (string[i] == " ")
27:     i = i - 1
28:   endwhile
29:   return this:canonicalize_spaces(string[start..i])
30: endif
31: "Last modified by Dax (#789) on Fri Jul 19 11:50:12 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]