diff options
author | murphy <murphy@rubychan.de> | 2009-06-13 01:24:56 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2009-06-13 01:24:56 +0000 |
commit | 6287a02ff06e5f3af73e031117ab3876f1db348a (patch) | |
tree | c2eac7073e6bcf84054ee20601f4f824c31ce751 | |
parent | 052399c510acf6bb5ae374b7270acbdf9b861b71 (diff) | |
download | coderay-6287a02ff06e5f3af73e031117ab3876f1db348a.tar.gz |
Python Scanner (issue #41) updated:
* class and method definitions are highlighted
* improved keyword argument recognition (less false positives)
* backticks are operators now
* from/import support still missing
-rw-r--r-- | lib/coderay/scanners/python.rb | 123 | ||||
-rw-r--r-- | test/scanners/python/pleac.expected.raydebug | 974 | ||||
-rw-r--r-- | test/scanners/python/unistring.expected.raydebug | 4 |
3 files changed, 560 insertions, 541 deletions
diff --git a/lib/coderay/scanners/python.rb b/lib/coderay/scanners/python.rb index f72a29e..47fba08 100644 --- a/lib/coderay/scanners/python.rb +++ b/lib/coderay/scanners/python.rb @@ -70,7 +70,7 @@ module Scanners [,;:()\[\]{}] | # simple delimiters \/\/=? | \*\*=? | # special math [-+*\/%&|^]=? | # ordinary math and binary logic - ~ | # binary complement + [~`] | # binary complement and inspection <<=? | >>=? | [<>=]=? | != # comparison and assignment /x @@ -82,10 +82,16 @@ module Scanners h[delimiter] = / [^\\\n]+? (?= \\ | $ | #{Regexp.escape(delimiter)} ) /x end + DEF_NEW_STATE = WordList.new(:initial). + add(%w(def), :def_expected). + # add(%w(import from), :include_expected). + add(%w(class), :class_expected) + def scan_tokens tokens, options state = :initial string_delimiter = nil + string_raw = false import_clause = class_name_follows = last_token_dot = false unicode = string.respond_to?(:encoding) && string.encoding.name == 'UTF-8' @@ -94,19 +100,41 @@ module Scanners kind = nil match = nil - case state - - when :initial - - if match = scan(/ [ \t]+ | \\?\n /x) - tokens << [match, :space] - next - - elsif match = scan(/ \# [^\n]* /mx) - tokens << [match, :comment] + if state == :string + if scan(STRING_DELIMITER_REGEXP[string_delimiter]) + tokens << [matched, :delimiter] + tokens << [:close, :string] + state = :initial next + elsif string_delimiter.size == 3 && scan(/\n/) + kind = :content + elsif scan(STRING_CONTENT_REGEXP[string_delimiter]) + kind = :content + elsif !string_raw && scan(/ \\ #{ESCAPE} /ox) + kind = :char + elsif scan(/ \\ #{UNICODE_ESCAPE} /ox) + kind = :char + elsif scan(/ \\ . /x) + kind = :content + elsif scan(/ \\ | $ /x) + tokens << [:close, :string] + kind = :error + state = :initial + else + raise_inspect "else case \" reached; %p not handled." % peek(1), tokens, state + end + + elsif match = scan(/ [ \t]+ | \\?\n /x) + tokens << [match, :space] + next + + elsif match = scan(/ \# [^\n]* /mx) + tokens << [match, :comment] + next + + elsif state == :initial - elsif scan(/#{OPERATOR}/o) + if scan(/#{OPERATOR}/o) kind = :operator elsif match = scan(/(u?r?|b)?("""|"|'''|')/i) @@ -122,14 +150,20 @@ module Scanners state = :string kind = :delimiter - elsif match = (unicode && scan(/[[:alpha:]_]\w*/ux)) || - scan(/[[:alpha:]_]\w*/x) + # TODO: backticks + + elsif match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) kind = IDENT_KIND[match] - # TODO: handle class, def, from, import + # TODO: from, import # TODO: keyword arguments kind = :ident if last_token_dot - kind = check(/\(/) ? :ident : :keyword if kind == :old_keyword - kind = :ident if kind == :predefined && check(/=/) + if kind == :old_keyword + kind = check(/\(/) ? :ident : :keyword + elsif kind == :predefined && check(/ *=/) + kind = :ident + elsif kind == :keyword + state = DEF_NEW_STATE[match] + end elsif scan(/@[a-zA-Z0-9_.]+[lL]?/) kind = :decorator @@ -162,51 +196,36 @@ module Scanners kind = :error end - - when :string - if scan(STRING_DELIMITER_REGEXP[string_delimiter]) - tokens << [matched, :delimiter] - tokens << [:close, :string] - state = :initial - next - elsif string_delimiter.size == 3 && scan(/\n/) - kind = :content - elsif scan(STRING_CONTENT_REGEXP[string_delimiter]) - kind = :content - elsif !string_raw && scan(/ \\ #{ESCAPE} /ox) - kind = :char - elsif scan(/ \\ #{UNICODE_ESCAPE} /ox) - kind = :char - elsif scan(/ \\ . /x) - kind = :content - elsif scan(/ \\ | $ /x) - tokens << [:close, :string] - kind = :error - state = :initial + + elsif state == :def_expected + state = :initial + if match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + kind = :method else - raise_inspect "else case \" reached; %p not handled." % peek(1), tokens, state + next end - when :include_expected - if scan(/<[^>\n]+>?|"[^"\n\\]*(?:\\.[^"\n\\]*)*"?/) - kind = :include - state = :initial - - elsif match = scan(/\s+/) - kind = :space - state = :initial if match.index ?\n - + elsif state == :class_expected + state = :initial + if match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + kind = :class else - getch - kind = :error + next + end + elsif state == :include_expected + state = :initial + if match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + kind = :include + else + next end else raise_inspect 'Unknown state', tokens, state - + end - + match ||= matched if $DEBUG and not kind raise_inspect 'Error token %p in line %d' % diff --git a/test/scanners/python/pleac.expected.raydebug b/test/scanners/python/pleac.expected.raydebug index d4af49e..b0c64fa 100644 --- a/test/scanners/python/pleac.expected.raydebug +++ b/test/scanners/python/pleac.expected.raydebug @@ -126,7 +126,7 @@ keyword(if) keyword(not) ident(myvar)operator(:) comment(# If you want a default value that can be overridden by the person calling ) comment(# your code, you can often wrap it in a function with a named parameter:) -keyword(def) ident(myfunc)operator(()ident(myvar)operator(=)string<delimiter(")content(a)delimiter(")>operator(\))operator(:) +keyword(def) method(myfunc)operator(()ident(myvar)operator(=)string<delimiter(")content(a)delimiter(")>operator(\))operator(:) keyword(return) ident(myvar) operator(+) string<delimiter(")content(b)delimiter(")> keyword(print) ident(myfunc)operator(()operator(\))operator(,) ident(myfunc)operator(()string<delimiter(")content(c)delimiter(")>operator(\)) comment(#=> ab cb) @@ -135,14 +135,14 @@ comment(# Note, though, that this won't work for mutable objects such as lists o comment(# dicts that are mutated in the function as the object is only created once ) comment(# and repeated calls to the same function will return the same object. This) comment(# can be desired behaviour however - see section 10.3, for instance.) -keyword(def) ident(myfunc)operator(()ident(myvar)operator(=)operator([)operator(])operator(\))operator(:) +keyword(def) method(myfunc)operator(()ident(myvar)operator(=)operator([)operator(])operator(\))operator(:) ident(myvar)operator(.)ident(append)operator(()string<delimiter(")content(x)delimiter(")>operator(\)) keyword(return) ident(myvar) keyword(print) ident(myfunc)operator(()operator(\))operator(,) ident(myfunc)operator(()operator(\)) comment(#=> ['x'] ['x', 'x']) comment(# You need to do:) -keyword(def) ident(myfunc)operator(()ident(myvar)operator(=)pre_constant(None)operator(\))operator(:) +keyword(def) method(myfunc)operator(()ident(myvar)operator(=)pre_constant(None)operator(\))operator(:) keyword(if) ident(myvar) keyword(is) pre_constant(None)operator(:) ident(myvar) operator(=) operator([)operator(]) ident(myvar)operator(.)ident(append)operator(()string<delimiter(")content(x)delimiter(")>operator(\)) @@ -254,7 +254,7 @@ keyword(print) string<delimiter(")content(total is %s for '%s'.)delimiter(")>ope comment(#=> total is 1248 for 'an apple a day'.) comment(#-----------------------------) comment(# sysv checksum) -keyword(def) ident(checksum)operator(()ident(myfile)operator(\))operator(:) +keyword(def) method(checksum)operator(()ident(myfile)operator(\))operator(:) ident(values) operator(=) operator([)predefined(ord)operator(()ident(c)operator(\)) keyword(for) ident(line) keyword(in) ident(myfile) keyword(for) ident(c) keyword(in) ident(line)operator(]) keyword(return) predefined(sum)operator(()ident(values)operator(\))operator(%)operator(()integer(2)operator(**)integer(16)operator(\)) operator(-) integer(1) @@ -311,7 +311,7 @@ ident(word) operator(=) string<delimiter(")content(reviver)delimiter(")> ident(is_palindrome) operator(=) operator(()ident(word) operator(==) ident(word)operator([)operator(:)operator(:)operator(-)integer(1)operator(])operator(\)) comment(#-----------------------------) comment(# Generator version) -keyword(def) ident(get_palindromes)operator(()ident(fname)operator(\))operator(:) +keyword(def) method(get_palindromes)operator(()ident(fname)operator(\))operator(:) keyword(for) ident(line) keyword(in) predefined(open)operator(()ident(fname)operator(\))operator(:) ident(word) operator(=) ident(line)operator(.)ident(rstrip)operator(()operator(\)) keyword(if) predefined(len)operator(()ident(word)operator(\)) operator(>) integer(5) keyword(and) ident(word) operator(==) ident(word)operator([)operator(:)operator(:)operator(-)integer(1)operator(])operator(:) @@ -319,7 +319,7 @@ keyword(def) ident(get_palindromes)operator(()ident(fname)operator(\))operator(: ident(long_palindromes) operator(=) predefined(list)operator(()ident(get_palindromes)operator(()string<delimiter(")content(/usr/share/dict/words)delimiter(")>operator(\))operator(\)) comment(# Simpler old-style version using 2.2 string reversal) -keyword(def) ident(rev_string)operator(()ident(mystr)operator(\))operator(:) +keyword(def) method(rev_string)operator(()ident(mystr)operator(\))operator(:) ident(mylist) operator(=) predefined(list)operator(()ident(mystr)operator(\)) ident(mylist)operator(.)ident(reverse)operator(()operator(\)) keyword(return) string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(mylist)operator(\)) @@ -355,8 +355,8 @@ comment(#=> I am 34 years old) comment(#-----------------------------) comment(# expand variables in text, but put an error message in) comment(# if the variable isn't defined) -keyword(class) ident(SafeDict)operator(()predefined(dict)operator(\))operator(:) - keyword(def) ident(__getitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\))operator(:) +keyword(class) class(SafeDict)operator(()predefined(dict)operator(\))operator(:) + keyword(def) method(__getitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(get)operator(()ident(key)operator(,) string<delimiter(")content([No Variable: %s])delimiter(")>operator(%)ident(key)operator(\)) ident(hi) operator(=) string<delimiter(")content(Hello)delimiter(")> @@ -390,13 +390,13 @@ keyword(if) ident(a)operator(.)ident(upper)operator(()operator(\)) operator(==) keyword(print) string<delimiter(")content(a and b are the same)delimiter(")> comment(#-----------------------------) keyword(import) ident(random) -keyword(def) ident(randcase_one)operator(()ident(letter)operator(\))operator(:) +keyword(def) method(randcase_one)operator(()ident(letter)operator(\))operator(:) keyword(if) ident(random)operator(.)ident(randint)operator(()integer(0)operator(,)integer(5)operator(\))operator(:) comment(# True on 1, 2, 3, 4) keyword(return) ident(letter)operator(.)ident(lower)operator(()operator(\)) keyword(else)operator(:) keyword(return) ident(letter)operator(.)ident(upper)operator(()operator(\)) -keyword(def) ident(randcase)operator(()ident(myfile)operator(\))operator(:) +keyword(def) method(randcase)operator(()ident(myfile)operator(\))operator(:) keyword(for) ident(line) keyword(in) ident(myfile)operator(:) keyword(yield) string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(randcase_one)operator(()ident(letter)operator(\)) keyword(for) ident(letter) keyword(in) ident(line)operator([)operator(:)operator(-)integer(1)operator(])operator(\)) @@ -529,7 +529,7 @@ comment(# Be aware that this will work on Unix but not on Windows.) keyword(from) ident(termwrap) keyword(import) ident(wrap) keyword(import) ident(struct)operator(,) ident(fcntl) -keyword(def) ident(getheightwidth)operator(()operator(\))operator(:) +keyword(def) method(getheightwidth)operator(()operator(\))operator(:) ident(height)operator(,) ident(width) operator(=) ident(struct)operator(.)ident(unpack)operator(() string<delimiter(")content(hhhh)delimiter(")>operator(,) ident(fcntl)operator(.)ident(ioctl)operator(()integer(0)operator(,) ident(TERMIOS)operator(.)ident(TIOCGWINSZ) operator(,)string<delimiter(")char(\\000)delimiter(")>operator(*)integer(8)operator(\))operator(\))operator([)integer(0)operator(:)integer(2)operator(]) keyword(return) ident(height)operator(,) ident(width) @@ -561,7 +561,7 @@ ident(mystr) operator(=) ident(mystr)operator(.)ident(strip)operator(()operator( comment(# @@PLEAC@@_1.15) comment(#-----------------------------) keyword(import) ident(csv) -keyword(def) ident(parse_csv)operator(()ident(line)operator(\))operator(:) +keyword(def) method(parse_csv)operator(()ident(line)operator(\))operator(:) ident(reader) operator(=) ident(csv)operator(.)ident(reader)operator(()operator([)ident(line)operator(])operator(,) ident(escapechar)operator(=)string<delimiter(')char(\\\\)delimiter(')>operator(\)) keyword(return) ident(reader)operator(.)ident(next)operator(()operator(\)) @@ -574,7 +574,7 @@ keyword(for) ident(i)operator(,) ident(field) keyword(in) predefined(enumerate)o comment(# pre-2.3 version of parse_csv) keyword(import) ident(re) -keyword(def) ident(parse_csv)operator(()ident(text)operator(\))operator(:) +keyword(def) method(parse_csv)operator(()ident(text)operator(\))operator(:) ident(pattern) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(''')content("([^")char(\\\\)content(\\])content(*(?:)char(\\\\)content(\\.)content([^")char(\\\\)content(\\])content(*\)*\)",?|([^,]+\),?|,)delimiter(''')>operator(\)) ident(mylist) operator(=) operator([)string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(elem)operator(\)) keyword(for) ident(elem) keyword(in) ident(re)operator(.)ident(findall)operator(()ident(pattern)operator(,) ident(text)operator(\))operator(]) @@ -592,7 +592,7 @@ comment(#-----------------------------) comment(# @@PLEAC@@_1.16) comment(#-----------------------------) -keyword(def) ident(soundex)operator(()ident(name)operator(,) predefined(len)operator(=)integer(4)operator(\))operator(:) +keyword(def) method(soundex)operator(()ident(name)operator(,) ident(len)operator(=)integer(4)operator(\))operator(:) string<delimiter(""")content( soundex module conforming to Knuth's algorithm)content( )content( implementation 2000-12-24 by Gregory Jorgensen)content( )content( public domain)content( @@ -699,15 +699,15 @@ comment(# examples :) comment(# psgrep "uid<10") keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(re) -keyword(class) ident(PsLineMatch)operator(:) +keyword(class) class(PsLineMatch)operator(:) comment(# each field from the PS header) ident(fieldnames) operator(=) operator(()string<delimiter(")content(flags)delimiter(")>operator(,)string<delimiter(")content(uid)delimiter(")>operator(,)string<delimiter(")content(pid)delimiter(")>operator(,)string<delimiter(")content(ppid)delimiter(")>operator(,)string<delimiter(")content(pri)delimiter(")>operator(,)string<delimiter(")content(nice)delimiter(")>operator(,)string<delimiter(")content(size)delimiter(")>operator(,) \ string<delimiter(")content(rss)delimiter(")>operator(,)string<delimiter(")content(wchan)delimiter(")>operator(,)string<delimiter(")content(stat)delimiter(")>operator(,)string<delimiter(")content(tty)delimiter(")>operator(,)string<delimiter(")content(time)delimiter(")>operator(,)string<delimiter(")content(command)delimiter(")>operator(\)) ident(numeric_fields) operator(=) operator(()string<delimiter(")content(flags)delimiter(")>operator(,)string<delimiter(")content(uid)delimiter(")>operator(,)string<delimiter(")content(pid)delimiter(")>operator(,)string<delimiter(")content(ppid)delimiter(")>operator(,)string<delimiter(")content(pri)delimiter(")>operator(,)string<delimiter(")content(nice)delimiter(")>operator(,)string<delimiter(")content(size)delimiter(")>operator(,)string<delimiter(")content(rss)delimiter(")>operator(\)) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(_fields) operator(=) operator({)operator(}) - keyword(def) ident(new_line)operator(()pre_constant(self)operator(,) ident(ln)operator(\))operator(:) + keyword(def) method(new_line)operator(()pre_constant(self)operator(,) ident(ln)operator(\))operator(:) pre_constant(self)operator(.)ident(_ln) operator(=) ident(ln)operator(.)ident(rstrip)operator(()operator(\)) comment(# ps header for option "wwaxl" (different than in the perl code\)) string<delimiter(""")content( @@ -724,7 +724,7 @@ keyword(class) ident(PsLineMatch)operator(:) keyword(else)operator(:) pre_constant(self)operator(.)ident(_fields)operator([)ident(fn)operator(]) operator(=) ident(elem) - keyword(def) ident(set_query)operator(()pre_constant(self)operator(,) ident(args)operator(\))operator(:) + keyword(def) method(set_query)operator(()pre_constant(self)operator(,) ident(args)operator(\))operator(:) comment(# assume args: "uid==500", "command ~ ^wm") ident(conds)operator(=)operator([)operator(]) ident(m) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content(()content(\\w)content(+\)([=<>]+\)(.+\))delimiter(")>operator(\)) @@ -740,10 +740,10 @@ keyword(class) ident(PsLineMatch)operator(:) ident(conds)operator(.)ident(append)operator(()string<delimiter(")content(%s%s'%s')delimiter(")>operator(,)operator(()ident(field)operator(,)ident(op)operator(,)ident(val)operator(\))operator(\)) pre_constant(self)operator(.)ident(_desirable) operator(=) predefined(compile)operator(()string<delimiter(")content((()delimiter(")>operator(+)string<delimiter(")content(\)and()delimiter(")>operator(.)ident(join)operator(()ident(conds)operator(\))operator(+)string<delimiter(")content(\)\))delimiter(")>operator(,) string<delimiter(")content(<string>)delimiter(")>operator(,)string<delimiter(")content(eval)delimiter(")>operator(\)) - keyword(def) ident(is_desirable)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(is_desirable)operator(()pre_constant(self)operator(\))operator(:) keyword(return) predefined(eval)operator(()pre_constant(self)operator(.)ident(_desirable)operator(,) operator({)operator(})operator(,) pre_constant(self)operator(.)ident(_fields)operator(\)) - keyword(def) ident(__str__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__str__)operator(()pre_constant(self)operator(\))operator(:) comment(# to allow "print".) keyword(return) pre_constant(self)operator(.)ident(_ln) @@ -812,7 +812,7 @@ comment(#-----------------------------) comment(# equal(num1, num2, accuracy\) : returns true if num1 and num2 are) comment(# equal to accuracy number of decimal places) -keyword(def) ident(equal)operator(()ident(num1)operator(,) ident(num2)operator(,) ident(accuracy)operator(\))operator(:) +keyword(def) method(equal)operator(()ident(num1)operator(,) ident(num2)operator(,) ident(accuracy)operator(\))operator(:) keyword(return) predefined(abs)operator(()ident(num1) operator(-) ident(num2)operator(\)) operator(<) integer(10)operator(**)operator(()operator(-)ident(accuracy)operator(\)) comment(#-----------------------------) keyword(from) ident(__future__) keyword(import) ident(division) comment(# use / for float div and // for int div) @@ -857,7 +857,7 @@ ident(num) operator(=) predefined(int)operator(()string<delimiter(')content(0110 comment(# To convert an int to an string representation in another base, you could use) comment(# <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/111286>:) keyword(import) ident(baseconvert) -keyword(def) ident(dec2bin)operator(()ident(i)operator(\))operator(:) +keyword(def) method(dec2bin)operator(()ident(i)operator(\))operator(:) keyword(return) ident(baseconvert)operator(.)ident(baseconvert)operator(()ident(i)operator(,) ident(baseconvert)operator(.)ident(BASE10)operator(,) ident(baseconvert)operator(.)ident(BASE2)operator(\)) ident(binstr) operator(=) ident(dec2bin)operator(()integer(54)operator(\)) comment(# binstr is 110110) @@ -952,14 +952,14 @@ ident(degrees) operator(=) ident(math)operator(.)ident(degrees)operator(()ident( comment(# pre-2.3:) keyword(from) ident(__future__) keyword(import) ident(division) keyword(import) ident(math) -keyword(def) ident(deg2rad)operator(()ident(degrees)operator(\))operator(:) +keyword(def) method(deg2rad)operator(()ident(degrees)operator(\))operator(:) keyword(return) operator(()ident(degrees) operator(/) integer(180)operator(\)) operator(*) ident(math)operator(.)ident(pi) -keyword(def) ident(rad2deg)operator(()ident(radians)operator(\))operator(:) +keyword(def) method(rad2deg)operator(()ident(radians)operator(\))operator(:) keyword(return) operator(()ident(radians) operator(/) ident(math)operator(.)ident(pi)operator(\)) operator(*) integer(180) comment(#-----------------------------) comment(# Use deg2rad instead of math.radians if you have pre-2.3 Python.) keyword(import) ident(math) -keyword(def) ident(degree_sine)operator(()ident(degrees)operator(\))operator(:) +keyword(def) method(degree_sine)operator(()ident(degrees)operator(\))operator(:) ident(radians) operator(=) ident(math)operator(.)ident(radians)operator(()ident(degrees)operator(\)) keyword(return) ident(math)operator(.)ident(sin)operator(()ident(radians)operator(\)) comment(#-----------------------------) @@ -969,7 +969,7 @@ comment(#-----------------------------) keyword(import) ident(math) comment(# DON'T DO THIS. Use math.tan(\) instead.) -keyword(def) ident(tan)operator(()ident(theta)operator(\))operator(:) +keyword(def) method(tan)operator(()ident(theta)operator(\))operator(:) keyword(return) ident(math)operator(.)ident(sin)operator(()ident(theta)operator(\)) operator(/) ident(math)operator(.)ident(cos)operator(()ident(theta)operator(\)) comment(#----------------) comment(# NOTE: this sets y to 16331239353195370.0) @@ -986,7 +986,7 @@ ident(log_e) operator(=) ident(math)operator(.)ident(log)operator(()ident(VALUE) comment(#-----------------------------) ident(log_10) operator(=) ident(math)operator(.)ident(log10)operator(()ident(VALUE)operator(\)) comment(#-----------------------------) -keyword(def) ident(log_base)operator(()ident(base)operator(,) ident(value)operator(\))operator(:) +keyword(def) method(log_base)operator(()ident(base)operator(,) ident(value)operator(\))operator(:) keyword(return) ident(math)operator(.)ident(log)operator(()ident(value)operator(\)) operator(/) ident(math)operator(.)ident(log)operator(()ident(base)operator(\)) comment(#-----------------------------) comment(# log_base defined as above) @@ -1052,7 +1052,7 @@ comment(#-----------------------------) comment(# @@PLEAC@@_2.17) comment(#-----------------------------) -keyword(def) ident(commify)operator(()ident(amount)operator(\))operator(:) +keyword(def) method(commify)operator(()ident(amount)operator(\))operator(:) ident(amount) operator(=) predefined(str)operator(()ident(amount)operator(\)) ident(firstcomma) operator(=) predefined(len)operator(()ident(amount)operator(\))operator(%)integer(3) keyword(or) integer(3) comment(# set to 3 if would make a leading comma) ident(first)operator(,) ident(rest) operator(=) ident(amount)operator([)operator(:)ident(firstcomma)operator(])operator(,) ident(amount)operator([)ident(firstcomma)operator(:)operator(]) @@ -1065,7 +1065,7 @@ comment(#=> 12,345,678) comment(# DON'T DO THIS. It works on 2.3+ only and is slower and less straightforward) comment(# than the non-regex version above.) keyword(import) ident(re) -keyword(def) ident(commify)operator(()ident(amount)operator(\))operator(:) +keyword(def) method(commify)operator(()ident(amount)operator(\))operator(:) ident(amount) operator(=) predefined(str)operator(()ident(amount)operator(\)) ident(amount) operator(=) ident(amount)operator([)operator(:)operator(:)operator(-)integer(1)operator(]) ident(amount) operator(=) ident(re)operator(.)ident(sub)operator(()string<modifier(r)delimiter(")content(()content(\\d)content(\\d)content(\\d)content(\)(?=)content(\\d)content(\)(?!)content(\\d)content(*)content(\\.)content(\))delimiter(")>operator(,) string<modifier(r)delimiter(")content(\\1)content(,)delimiter(")>operator(,) ident(amount)operator(\)) @@ -1074,7 +1074,7 @@ keyword(def) ident(commify)operator(()ident(amount)operator(\))operator(:) comment(# @@PLEAC@@_2.18) comment(# Printing Correct Plurals) comment(#-----------------------------) -keyword(def) ident(pluralise)operator(()ident(value)operator(,) ident(root)operator(,) ident(singular)operator(=)string<delimiter(")delimiter(")>operator(,) ident(plural)operator(=)string<delimiter(")content(s)delimiter(")>operator(\))operator(:) +keyword(def) method(pluralise)operator(()ident(value)operator(,) ident(root)operator(,) ident(singular)operator(=)string<delimiter(")delimiter(")>operator(,) ident(plural)operator(=)string<delimiter(")content(s)delimiter(")>operator(\))operator(:) keyword(if) ident(value) operator(==) integer(1)operator(:) keyword(return) ident(root) operator(+) ident(singular) keyword(else)operator(:) @@ -1087,7 +1087,7 @@ keyword(print) string<delimiter(")content(%d %s %s enough.)delimiter(")> operato ident(pluralise)operator(()ident(duration)operator(,) string<delimiter(')delimiter(')>operator(,) string<delimiter(')content(is)delimiter(')>operator(,) string<delimiter(')content(are)delimiter(')>operator(\))operator(\)) comment(#-----------------------------) keyword(import) ident(re) -keyword(def) ident(noun_plural)operator(()ident(word)operator(\))operator(:) +keyword(def) method(noun_plural)operator(()ident(word)operator(\))operator(:) ident(endings) operator(=) operator([)operator(()string<delimiter(")content(ss)delimiter(")>operator(,) string<delimiter(")content(sses)delimiter(")>operator(\))operator(,) operator(()string<delimiter(")content(([psc]h\))delimiter(")>operator(,) string<modifier(r)delimiter(")content(\\1)content(es)delimiter(")>operator(\))operator(,) operator(()string<delimiter(")content(z)delimiter(")>operator(,) string<delimiter(")content(zes)delimiter(")>operator(\))operator(,) @@ -1127,7 +1127,7 @@ comment(#25000000000000000000000000 2**24 5**26) comment(#-----------------------------) keyword(import) ident(sys) -keyword(def) ident(factorise)operator(()ident(num)operator(\))operator(:) +keyword(def) method(factorise)operator(()ident(num)operator(\))operator(:) ident(factors) operator(=) operator({)operator(}) ident(orig) operator(=) ident(num) keyword(print) ident(num)operator(,) string<delimiter(')char(\\t)delimiter(')>operator(,) @@ -1168,12 +1168,12 @@ keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)del keyword(print) ident(strnum)operator(,) string<delimiter(")content(is not an integer)delimiter(")> comment(#-----------------------------) comment(# A more Pythonic variant (which separates calculation from printing\):) -keyword(def) ident(format_factor)operator(()ident(base)operator(,) ident(exponent)operator(\))operator(:) +keyword(def) method(format_factor)operator(()ident(base)operator(,) ident(exponent)operator(\))operator(:) keyword(if) ident(exponent) operator(>) integer(1)operator(:) keyword(return) string<delimiter(")content(%s**%s)delimiter(")>operator(%)operator(()ident(base)operator(,) ident(exponent)operator(\)) keyword(return) predefined(str)operator(()ident(base)operator(\)) -keyword(def) ident(factorise)operator(()ident(num)operator(\))operator(:) +keyword(def) method(factorise)operator(()ident(num)operator(\))operator(:) ident(factors) operator(=) operator({)operator(}) ident(orig) operator(=) ident(num) @@ -1196,7 +1196,7 @@ keyword(def) ident(factorise)operator(()ident(num)operator(\))operator(:) keyword(for) ident(base)operator(,) ident(exponent) keyword(in) predefined(sorted)operator(()ident(factors)operator(.)ident(items)operator(()operator(\))operator(\))operator(]) keyword(return) ident(out) -keyword(def) ident(print_factors)operator(()ident(value)operator(\))operator(:) +keyword(def) method(print_factors)operator(()ident(value)operator(\))operator(:) keyword(try)operator(:) ident(num) operator(=) predefined(int)operator(()ident(value)operator(\)) keyword(if) ident(num) operator(!=) predefined(float)operator(()ident(value)operator(\))operator(:) @@ -1441,7 +1441,7 @@ comment(# might appear in the output\).) keyword(import) ident(datetime)operator(,) ident(email)operator(,) ident(email)operator(.)ident(Utils) keyword(import) ident(os)operator(,) ident(sys)operator(,) ident(time) -keyword(def) ident(extract_date)operator(()ident(hop)operator(\))operator(:) +keyword(def) method(extract_date)operator(()ident(hop)operator(\))operator(:) comment(# According to RFC822, the date will be prefixed with) comment(# a semi-colon, and is the last part of a received) comment(# header.) @@ -1454,7 +1454,7 @@ keyword(def) ident(extract_date)operator(()ident(hop)operator(\))operator(:) ident(dt) operator(=) ident(datetime)operator(.)ident(datetime)operator(.)ident(fromtimestamp)operator(()ident(EpochSeconds)operator(\)) keyword(return) ident(dt) -keyword(def) ident(process)operator(()ident(filename)operator(\))operator(:) +keyword(def) method(process)operator(()ident(filename)operator(\))operator(:) comment(# Main email file processing) comment(# read the headers and process them) ident(f) operator(=) predefined(file)operator(()ident(filename)operator(,) string<delimiter(')content(rb)delimiter(')>operator(\)) @@ -1482,7 +1482,7 @@ keyword(def) ident(process)operator(()ident(filename)operator(\))operator(:) ident(results)operator(.)ident(append)operator(()operator(()ident(sender)operator(,) ident(receiver)operator(,) ident(date)operator(\))operator(\)) ident(output)operator(()ident(results)operator(\)) -keyword(def) ident(output)operator(()ident(results)operator(\))operator(:) +keyword(def) method(output)operator(()ident(results)operator(\))operator(:) keyword(print) string<delimiter(")content(Sender, Recipient, Time, Delta)delimiter(")> keyword(print) ident(previous_dt) operator(=) ident(delta) operator(=) integer(0) @@ -1497,7 +1497,7 @@ keyword(def) ident(output)operator(()ident(results)operator(\))operator(:) keyword(print) ident(previous_dt) operator(=) ident(date) -keyword(def) ident(main)operator(()operator(\))operator(:) +keyword(def) method(main)operator(()operator(\))operator(:) comment(# Perform some basic argument checking) keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\)) operator(!=) integer(2)operator(:) keyword(print) string<delimiter(")content(Usage: mailhop.py FILENAME)delimiter(")> @@ -1572,7 +1572,7 @@ comment(#-----------------------------) comment(# @@PLEAC@@_4.2) comment(#-----------------------------) -keyword(def) ident(commify_series)operator(()ident(args)operator(\))operator(:) +keyword(def) method(commify_series)operator(()ident(args)operator(\))operator(:) ident(n) operator(=) predefined(len)operator(()ident(args)operator(\)) keyword(if) ident(n) operator(==) integer(0)operator(:) keyword(return) string<delimiter(")delimiter(")> @@ -1608,7 +1608,7 @@ ident(data) operator(=) operator(() string<delimiter(')content(sleep and dream peacefully)delimiter(')> operator(\))operator(,) operator(\)) -keyword(def) ident(commify_series)operator(()ident(terms)operator(\))operator(:) +keyword(def) method(commify_series)operator(()ident(terms)operator(\))operator(:) keyword(for) ident(term) keyword(in) ident(terms)operator(:) keyword(if) string<delimiter(")content(,)delimiter(")> keyword(in) ident(term)operator(:) ident(sepchar) operator(=) string<delimiter(")content(; )delimiter(")> @@ -1684,7 +1684,7 @@ comment(# File "<pyshell#16>", line 1, in -toplevel-) comment(# print x[1000]) comment(# IndexError: list index out of range) comment(#-----------------------------) -keyword(def) ident(what_about_that_list)operator(()ident(terms)operator(\))operator(:) +keyword(def) method(what_about_that_list)operator(()ident(terms)operator(\))operator(:) keyword(print) string<delimiter(")content(The list now has)delimiter(")>operator(,) predefined(len)operator(()ident(terms)operator(\))operator(,) string<delimiter(")content(elements.)delimiter(")> keyword(print) string<delimiter(")content(The index of the last element is)delimiter(")>operator(,) predefined(len)operator(()ident(terms)operator(\))operator(-)integer(1)operator(,) string<delimiter(")content((or -1\).)delimiter(")> keyword(print) string<delimiter(")content(Element #3 is %s.)delimiter(")> operator(%) ident(terms)operator([)integer(3)operator(]) @@ -2044,12 +2044,12 @@ comment(# remove 1 element from the end of mylist, saving it in end:) ident(end) operator(=) ident(mylist)operator(.)ident(pop)operator(()operator(\)) comment(#-----------------------------) -keyword(def) ident(shift2)operator(()ident(terms)operator(\))operator(:) +keyword(def) method(shift2)operator(()ident(terms)operator(\))operator(:) ident(front) operator(=) ident(terms)operator([)operator(:)integer(2)operator(]) ident(terms)operator([)operator(:)integer(2)operator(]) operator(=) operator([)operator(]) keyword(return) ident(front) -keyword(def) ident(pop2)operator(()ident(terms)operator(\))operator(:) +keyword(def) method(pop2)operator(()ident(terms)operator(\))operator(:) ident(back) operator(=) ident(terms)operator([)operator(-)integer(2)operator(:)operator(]) ident(terms)operator([)operator(-)integer(2)operator(:)operator(]) operator(=) operator([)operator(]) keyword(return) ident(back) @@ -2165,7 +2165,7 @@ ident(allnums) operator(=) predefined(sorted)operator(()ident(allnums)operator(, comment(#-----------------------------) comment(# @@PLEAC@@_4.15) -ident(ordered) operator(=) predefined(sorted)operator(()ident(unordered)operator(,) predefined(cmp)operator(=)ident(compare)operator(\)) +ident(ordered) operator(=) predefined(sorted)operator(()ident(unordered)operator(,) ident(cmp)operator(=)ident(compare)operator(\)) comment(#-----------------------------) ident(ordered) operator(=) predefined(sorted)operator(()ident(unordered)operator(,) ident(key)operator(=)ident(compute)operator(\)) @@ -2175,7 +2175,7 @@ ident(precomputed)operator(.)ident(sort)operator(()keyword(lambda) ident(a)opera ident(ordered) operator(=) operator([)ident(v) keyword(for) ident(k)operator(,)ident(v) keyword(in) ident(precomputed)operator(.)ident(items)operator(()operator(\))operator(]) comment(#-----------------------------) comment(# DON'T DO THIS.) -keyword(def) ident(functional_sort)operator(()ident(mylist)operator(,) ident(function)operator(\))operator(:) +keyword(def) method(functional_sort)operator(()ident(mylist)operator(,) ident(function)operator(\))operator(:) ident(mylist)operator(.)ident(sort)operator(()ident(function)operator(\)) keyword(return) ident(mylist) @@ -2216,7 +2216,7 @@ ident(temp)operator(.)ident(sort)operator(()keyword(lambda) ident(a)operator(,) ident(sorted_list) operator(=) operator([)ident(x)operator([)integer(1)operator(]) keyword(for) ident(x) keyword(in) ident(temp)operator(]) comment(#-----------------------------) comment(# DON'T DO THIS.) -keyword(def) ident(functional_sort)operator(()ident(mylist)operator(,) ident(function)operator(\))operator(:) +keyword(def) method(functional_sort)operator(()ident(mylist)operator(,) ident(function)operator(\))operator(:) ident(mylist)operator(.)ident(sort)operator(()ident(function)operator(\)) keyword(return) ident(mylist) @@ -2239,12 +2239,12 @@ keyword(for) ident(process) keyword(in) ident(itertools)operator(.)ident(cycle)o comment(# pre 2.3:) keyword(import) ident(time) -keyword(class) ident(Circular)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) +keyword(class) class(Circular)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(assert) predefined(len)operator(()ident(data)operator(\)) operator(>=) integer(1)operator(,) string<delimiter(")content(Cannot use an empty list)delimiter(")> pre_constant(self)operator(.)ident(data) operator(=) ident(data) - keyword(def) ident(__iter__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__iter__)operator(()pre_constant(self)operator(\))operator(:) keyword(while) pre_constant(True)operator(:) keyword(for) ident(elem) keyword(in) pre_constant(self)operator(.)ident(data)operator(:) keyword(yield) ident(elem) @@ -2258,12 +2258,12 @@ keyword(for) ident(process) keyword(in) ident(circular)operator(:) comment(# DON'T DO THIS. All those pops and appends mean that the list needs to be ) comment(# constantly reallocated. This is rather bad if your list is large:) keyword(import) ident(time) -keyword(class) ident(Circular)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) +keyword(class) class(Circular)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(assert) predefined(len)operator(()ident(data)operator(\)) operator(>=) integer(1)operator(,) string<delimiter(")content(Cannot use an empty list)delimiter(")> pre_constant(self)operator(.)ident(data) operator(=) ident(data) - keyword(def) predefined(next)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(next)operator(()pre_constant(self)operator(\))operator(:) ident(head) operator(=) pre_constant(self)operator(.)ident(data)operator(.)ident(pop)operator(()integer(0)operator(\)) pre_constant(self)operator(.)ident(data)operator(.)ident(append)operator(()ident(head)operator(\)) keyword(return) ident(head) @@ -2286,7 +2286,7 @@ comment(# @@PLEAC@@_4.18) comment(#-----------------------------) keyword(import) ident(sys) -keyword(def) ident(make_columns)operator(()ident(mylist)operator(,) ident(screen_width)operator(=)integer(78)operator(\))operator(:) +keyword(def) method(make_columns)operator(()ident(mylist)operator(,) ident(screen_width)operator(=)integer(78)operator(\))operator(:) keyword(if) ident(mylist)operator(:) ident(maxlen) operator(=) predefined(max)operator(()operator([)predefined(len)operator(()ident(elem)operator(\)) keyword(for) ident(elem) keyword(in) ident(mylist)operator(])operator(\)) ident(maxlen) operator(+=) integer(1) comment(# to make extra space) @@ -2310,11 +2310,11 @@ comment(# A more literal translation) keyword(import) ident(sys) comment(# subroutine to check whether at last item on line) -keyword(def) ident(EOL)operator(()ident(item)operator(\))operator(:) +keyword(def) method(EOL)operator(()ident(item)operator(\))operator(:) keyword(return) operator(()ident(item)operator(+)integer(1)operator(\)) operator(%) ident(cols) operator(==) integer(0) comment(# Might not be portable to non-linux systems) -keyword(def) ident(getwinsize)operator(()operator(\))operator(:) +keyword(def) method(getwinsize)operator(()operator(\))operator(:) comment(# Use the curses module if installed) keyword(try)operator(:) keyword(import) ident(curses) @@ -2376,14 +2376,14 @@ comment(#-----------------------------) comment(# @@PLEAC@@_4.19) comment(#-----------------------------) -keyword(def) ident(factorial)operator(()ident(n)operator(\))operator(:) +keyword(def) method(factorial)operator(()ident(n)operator(\))operator(:) ident(s) operator(=) integer(1) keyword(while) ident(n)operator(:) ident(s) operator(*=) ident(n) ident(n) operator(-=) integer(1) keyword(return) ident(s) comment(#-----------------------------) -keyword(def) ident(permute)operator(()ident(alist)operator(,) ident(blist)operator(=)operator([)operator(])operator(\))operator(:) +keyword(def) method(permute)operator(()ident(alist)operator(,) ident(blist)operator(=)operator([)operator(])operator(\))operator(:) keyword(if) keyword(not) ident(alist)operator(:) keyword(yield) ident(blist) keyword(for) ident(i)operator(,) ident(elem) keyword(in) predefined(enumerate)operator(()ident(alist)operator(\))operator(:) @@ -2398,7 +2398,7 @@ keyword(import) ident(fileinput) comment(# Slightly modified from) comment(# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66463) -keyword(def) ident(print_list)operator(()ident(alist)operator(,) ident(blist)operator(=)operator([)operator(])operator(\))operator(:) +keyword(def) method(print_list)operator(()ident(alist)operator(,) ident(blist)operator(=)operator([)operator(])operator(\))operator(:) keyword(if) keyword(not) ident(alist)operator(:) keyword(print) string<delimiter(')content( )delimiter(')>operator(.)ident(join)operator(()ident(blist)operator(\)) keyword(for) ident(i) keyword(in) predefined(range)operator(()predefined(len)operator(()ident(alist)operator(\))operator(\))operator(:) @@ -2410,11 +2410,11 @@ keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)oper ident(words) operator(=) ident(line)operator(.)ident(split)operator(()operator(\)) ident(print_list)operator(()ident(words)operator(\)) comment(#-----------------------------) -keyword(class) ident(FactorialMemo)operator(()predefined(list)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(FactorialMemo)operator(()predefined(list)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(append)operator(()integer(1)operator(\)) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(,) ident(n)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(,) ident(n)operator(\))operator(:) keyword(try)operator(:) keyword(return) pre_constant(self)operator([)ident(n)operator(]) keyword(except) exception(IndexError)operator(:) @@ -2437,17 +2437,17 @@ keyword(print) string<delimiter(")content(Slow first time:)delimiter(")>operator keyword(print) string<delimiter(")content(Quicker the second time:)delimiter(")>operator(,) ident(f2) comment(#-----------------------------) -keyword(class) ident(MemoizedPermutations)operator(()predefined(list)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(alist)operator(\))operator(:) +keyword(class) class(MemoizedPermutations)operator(()predefined(list)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(alist)operator(\))operator(:) pre_constant(self)operator(.)ident(permute)operator(()ident(alist)operator(,) operator([)operator(])operator(\)) - keyword(def) ident(permute)operator(()pre_constant(self)operator(,) ident(alist)operator(,) ident(blist)operator(\))operator(:) + keyword(def) method(permute)operator(()pre_constant(self)operator(,) ident(alist)operator(,) ident(blist)operator(\))operator(:) keyword(if) keyword(not) ident(alist)operator(:) pre_constant(self)operator(.)ident(append)operator(()ident(blist)operator(\)) keyword(for) ident(i)operator(,) ident(elem) keyword(in) predefined(enumerate)operator(()ident(alist)operator(\))operator(:) pre_constant(self)operator(.)ident(permute)operator(()ident(alist)operator([)operator(:)ident(i)operator(]) operator(+) ident(alist)operator([)ident(i)operator(+)integer(1)operator(:)operator(])operator(,) ident(blist) operator(+) operator([)ident(elem)operator(])operator(\)) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(,) ident(seq)operator(,) ident(idx)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(,) ident(seq)operator(,) ident(idx)operator(\))operator(:) keyword(return) operator([)ident(seq)operator([)ident(n)operator(]) keyword(for) ident(n) keyword(in) pre_constant(self)operator([)ident(idx)operator(])operator(]) @@ -2548,7 +2548,7 @@ comment(# remove key and its value from mydict) keyword(del) ident(mydict)operator([)ident(key)operator(]) comment(#-----------------------------) comment(# food_color as per Introduction) -keyword(def) ident(print_foods)operator(()operator(\))operator(:) +keyword(def) method(print_foods)operator(()operator(\))operator(:) ident(foods) operator(=) ident(food_color)operator(.)ident(keys)operator(()operator(\)) keyword(print) string<delimiter(")content(Keys:)delimiter(")>operator(,) string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(foods)operator(\)) @@ -2667,30 +2667,30 @@ comment(#-----------------------------) comment(# @@PLEAC@@_5.6) comment(#-----------------------------) -keyword(class) ident(SequenceDict)operator(()predefined(dict)operator(\))operator(:) +keyword(class) class(SequenceDict)operator(()predefined(dict)operator(\))operator(:) string<delimiter(""")content( )content( Dictionary that remembers the insertion order.)content( )content( The lists returned by keys(\), values(\) and items(\) are)content( )content( in the insertion order.)content( )content( )delimiter(""")> - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) pre_constant(self)operator(.)ident(_keys)operator(=)operator({)operator(}) comment(# key --> id) pre_constant(self)operator(.)ident(_ids)operator(=)operator({)operator(}) comment(# id --> key) pre_constant(self)operator(.)ident(_next_id)operator(=)integer(0) - keyword(def) ident(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(value)operator(\))operator(:) pre_constant(self)operator(.)ident(_keys)operator([)ident(key)operator(])operator(=)pre_constant(self)operator(.)ident(_next_id) pre_constant(self)operator(.)ident(_ids)operator([)pre_constant(self)operator(.)ident(_next_id)operator(])operator(=)ident(key) pre_constant(self)operator(.)ident(_next_id)operator(+=)integer(1) keyword(return) predefined(dict)operator(.)ident(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(value)operator(\)) - keyword(def) ident(__delitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\))operator(:) - predefined(id)operator(=)pre_constant(self)operator(.)ident(_keys)operator([)ident(key)operator(]) + keyword(def) method(__delitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\))operator(:) + ident(id)operator(=)pre_constant(self)operator(.)ident(_keys)operator([)ident(key)operator(]) keyword(del)operator(()pre_constant(self)operator(.)ident(_keys)operator([)ident(key)operator(])operator(\)) keyword(del)operator(()pre_constant(self)operator(.)ident(_ids)operator([)predefined(id)operator(])operator(\)) keyword(return) predefined(dict)operator(.)ident(__delitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\)) - keyword(def) ident(values)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(values)operator(()pre_constant(self)operator(\))operator(:) ident(values)operator(=)operator([)operator(]) ident(ids)operator(=)predefined(list)operator(()pre_constant(self)operator(.)ident(_ids)operator(.)ident(items)operator(()operator(\))operator(\)) ident(ids)operator(.)ident(sort)operator(()operator(\)) @@ -2698,7 +2698,7 @@ keyword(class) ident(SequenceDict)operator(()predefined(dict)operator(\))operato ident(values)operator(.)ident(append)operator(()pre_constant(self)operator([)ident(key)operator(])operator(\)) keyword(return) ident(values) - keyword(def) ident(items)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(items)operator(()pre_constant(self)operator(\))operator(:) ident(items)operator(=)operator([)operator(]) ident(ids)operator(=)predefined(list)operator(()pre_constant(self)operator(.)ident(_ids)operator(.)ident(items)operator(()operator(\))operator(\)) ident(ids)operator(.)ident(sort)operator(()operator(\)) @@ -2706,7 +2706,7 @@ keyword(class) ident(SequenceDict)operator(()predefined(dict)operator(\))operato ident(items)operator(.)ident(append)operator(()operator(()ident(key)operator(,) pre_constant(self)operator([)ident(key)operator(])operator(\))operator(\)) keyword(return) ident(items) - keyword(def) ident(keys)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(keys)operator(()pre_constant(self)operator(\))operator(:) ident(ids)operator(=)predefined(list)operator(()pre_constant(self)operator(.)ident(_ids)operator(.)ident(items)operator(()operator(\))operator(\)) ident(ids)operator(.)ident(sort)operator(()operator(\)) ident(keys)operator(=)operator([)operator(]) @@ -2714,17 +2714,17 @@ keyword(class) ident(SequenceDict)operator(()predefined(dict)operator(\))operato ident(keys)operator(.)ident(append)operator(()ident(key)operator(\)) keyword(return) ident(keys) - keyword(def) ident(update)operator(()pre_constant(self)operator(,) ident(d)operator(\))operator(:) + keyword(def) method(update)operator(()pre_constant(self)operator(,) ident(d)operator(\))operator(:) keyword(for) ident(key)operator(,) ident(value) keyword(in) ident(d)operator(.)ident(items)operator(()operator(\))operator(:) pre_constant(self)operator([)ident(key)operator(])operator(=)ident(value) - keyword(def) ident(clear)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(clear)operator(()pre_constant(self)operator(\))operator(:) predefined(dict)operator(.)ident(clear)operator(()pre_constant(self)operator(\)) pre_constant(self)operator(.)ident(_keys)operator(=)operator({)operator(}) pre_constant(self)operator(.)ident(_ids)operator(=)operator({)operator(}) pre_constant(self)operator(.)ident(_next_id)operator(=)integer(0) -keyword(def) ident(testSequenceDict)operator(()operator(\))operator(:) +keyword(def) method(testSequenceDict)operator(()operator(\))operator(:) ident(sd)operator(=)ident(SequenceDict)operator(()operator(\)) comment(# First Test) @@ -2758,7 +2758,7 @@ keyword(def) ident(testSequenceDict)operator(()operator(\))operator(:) keyword(print) ident(sd)operator(.)ident(keys)operator(()operator(\))operator(,) ident(sd)operator(.)ident(items)operator(()operator(\))operator(,) ident(sd)operator(.)ident(values)operator(()operator(\)) keyword(print) ident(sd)operator(.)ident(_ids)operator(,) ident(sd)operator(.)ident(_keys) -keyword(def) ident(likePerlCookbook)operator(()operator(\))operator(:) +keyword(def) method(likePerlCookbook)operator(()operator(\))operator(:) ident(food_color)operator(=)ident(SequenceDict)operator(()operator(\)) ident(food_color)operator([)string<delimiter(")content(Banana)delimiter(")>operator(])operator(=)string<delimiter(")content(Yellow)delimiter(")>operator(;) ident(food_color)operator([)string<delimiter(")content(Apple)delimiter(")>operator(])operator(=)string<delimiter(")content(Green)delimiter(")>operator(;) @@ -2849,16 +2849,16 @@ keyword(for) ident(item) keyword(in) predefined(sorted)operator(()ident(food_col keyword(print) string<delimiter(")content(%s is %s.)delimiter(")> operator(%) ident(item) comment(#-----------------------------) comment(# NOTE: alternative version showing a user-defined function) -keyword(def) ident(food_cmp)operator(()ident(x)operator(,) ident(y)operator(\))operator(:) +keyword(def) method(food_cmp)operator(()ident(x)operator(,) ident(y)operator(\))operator(:) keyword(return) predefined(cmp)operator(()ident(x)operator(,) ident(y)operator(\)) -keyword(for) ident(food)operator(,) ident(color) keyword(in) predefined(sorted)operator(()ident(food_color)operator(,) predefined(cmp)operator(=)ident(food_cmp)operator(\))operator(:) +keyword(for) ident(food)operator(,) ident(color) keyword(in) predefined(sorted)operator(()ident(food_color)operator(,) ident(cmp)operator(=)ident(food_cmp)operator(\))operator(:) keyword(print) string<delimiter(")content(%s is %s.)delimiter(")> operator(%) operator(()ident(food)operator(,) ident(color)operator(\)) comment(#-----------------------------) -keyword(def) ident(food_len_cmp)operator(()ident(x)operator(,) ident(y)operator(\))operator(:) +keyword(def) method(food_len_cmp)operator(()ident(x)operator(,) ident(y)operator(\))operator(:) keyword(return) predefined(cmp)operator(()predefined(len)operator(()ident(x)operator(\))operator(,) predefined(len)operator(()ident(y)operator(\))operator(\)) -keyword(for) ident(food) keyword(in) predefined(sorted)operator(()ident(food_color)operator(,) predefined(cmp)operator(=)ident(food_len_cmp)operator(\))operator(:) +keyword(for) ident(food) keyword(in) predefined(sorted)operator(()ident(food_color)operator(,) ident(cmp)operator(=)ident(food_len_cmp)operator(\))operator(:) keyword(print) string<delimiter(")content(%s is %s.)delimiter(")> operator(%) operator(()ident(food)operator(,) ident(food_color)operator([)ident(food)operator(])operator(\)) comment(# In this instance, however, the following is both simpler and faster:) @@ -3034,7 +3034,7 @@ comment(#!/usr/bin/env python -w) comment(# dutree - print sorted indented rendition of du output) keyword(import) ident(os)operator(,) ident(sys) -keyword(def) ident(get_input)operator(()ident(args)operator(\))operator(:) +keyword(def) method(get_input)operator(()ident(args)operator(\))operator(:) comment(# NOTE: This is insecure - use only from trusted code!) ident(cmd) operator(=) string<delimiter(")content(du )delimiter(")> operator(+) string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(args)operator(\)) ident(infile) operator(=) ident(os)operator(.)ident(popen)operator(()ident(cmd)operator(\)) @@ -3053,7 +3053,7 @@ keyword(def) ident(get_input)operator(()ident(args)operator(\))operator(:) keyword(return) ident(name)operator(,) ident(dirsize)operator(,) ident(kids) -keyword(def) ident(getdots)operator(()ident(root)operator(,) ident(dirsize)operator(,) ident(kids)operator(\))operator(:) +keyword(def) method(getdots)operator(()ident(root)operator(,) ident(dirsize)operator(,) ident(kids)operator(\))operator(:) ident(size) operator(=) ident(cursize) operator(=) ident(dirsize)operator([)ident(root)operator(]) keyword(if) ident(kids)operator(.)ident(has_key)operator(()ident(root)operator(\))operator(:) keyword(for) ident(kid) keyword(in) ident(kids)operator([)ident(root)operator(])operator(:) @@ -3064,7 +3064,7 @@ keyword(def) ident(getdots)operator(()ident(root)operator(,) ident(dirsize)opera ident(dirsize)operator([)ident(dot)operator(]) operator(=) ident(cursize) ident(kids)operator([)ident(root)operator(])operator(.)ident(append)operator(()ident(dot)operator(\)) -keyword(def) ident(output)operator(()ident(root)operator(,) ident(dirsize)operator(,) ident(kids)operator(,) ident(prefix) operator(=) string<delimiter(")delimiter(")>operator(,) ident(width) operator(=) integer(0)operator(\))operator(:) +keyword(def) method(output)operator(()ident(root)operator(,) ident(dirsize)operator(,) ident(kids)operator(,) ident(prefix) operator(=) string<delimiter(")delimiter(")>operator(,) ident(width) operator(=) integer(0)operator(\))operator(:) ident(path) operator(=) ident(os)operator(.)ident(path)operator(.)ident(basename)operator(()ident(root)operator(\)) ident(size) operator(=) ident(dirsize)operator([)ident(root)operator(]) ident(fmt) operator(=) string<delimiter(")content(%)delimiter(")> operator(+) predefined(str)operator(()ident(width)operator(\)) operator(+) string<delimiter(")content(d %s)delimiter(")> @@ -3081,7 +3081,7 @@ keyword(def) ident(output)operator(()ident(root)operator(,) ident(dirsize)operat keyword(for) ident(kid) keyword(in) ident(kid_list)operator(:) ident(output)operator(()ident(kid)operator(,) ident(dirsize)operator(,) ident(kids)operator(,) ident(prefix)operator(,) ident(width)operator(\)) -keyword(def) ident(main)operator(()operator(\))operator(:) +keyword(def) method(main)operator(()operator(\))operator(:) ident(root)operator(,) ident(dirsize)operator(,) ident(kids) operator(=) ident(get_input)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(\)) ident(getdots)operator(()ident(root)operator(,) ident(dirsize)operator(,) ident(kids)operator(\)) ident(output)operator(()ident(root)operator(,) ident(dirsize)operator(,) ident(kids)operator(\)) @@ -3146,7 +3146,7 @@ ident(basename) operator(=) ident(re)operator(.)ident(sub)operator(()string<deli comment(# Make All Words Title-Cased) comment(# DON'T DO THIS - use str.title(\) instead) -keyword(def) ident(cap)operator(()ident(mo)operator(\))operator(:) keyword(return) ident(mo)operator(.)ident(group)operator(()operator(\))operator(.)ident(capitalize)operator(()operator(\)) +keyword(def) method(cap)operator(()ident(mo)operator(\))operator(:) keyword(return) ident(mo)operator(.)ident(group)operator(()operator(\))operator(.)ident(capitalize)operator(()operator(\)) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content((?P<n>)content(\\w)content(+\))delimiter(")>operator(,)ident(cap)operator(,)string<delimiter(")content(make all words title-cased)delimiter(")>operator(\)) comment(# /usr/man/man3/foo.1 changes to /usr/man/cat3/foo.1) @@ -3239,7 +3239,7 @@ ident(match) operator(=) ident(re)operator(.)ident(compile)operator(()string<del )content( \) # end of hostname capture)content( )content( )delimiter(""")>operator(,)ident(re)operator(.)ident(VERBOSE)operator(\)) comment(# for nice formatting) -keyword(def) ident(repl)operator(()ident(match_obj)operator(\))operator(:) +keyword(def) method(repl)operator(()ident(match_obj)operator(\))operator(:) ident(orig_hostname) operator(=) ident(match_obj)operator(.)ident(group)operator(()string<delimiter(")content(hostname)delimiter(")>operator(\)) keyword(try)operator(:) ident(addr) operator(=) ident(socket)operator(.)ident(gethostbyname)operator(()ident(orig_hostname)operator(\)) @@ -3310,7 +3310,7 @@ ident(evens) operator(=) operator([)ident(fish) keyword(for) operator(()ident(i) keyword(print) string<delimiter(")content(Even numbered fish are %s.)delimiter(")> operator(%) operator(()string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(evens)operator(\))operator(\)) comment(##-----------------------------) ident(count) operator(=) integer(0) -keyword(def) ident(four_is_sushi)operator(()ident(match_obj)operator(\))operator(:) +keyword(def) method(four_is_sushi)operator(()ident(match_obj)operator(\))operator(:) keyword(global) ident(count) ident(count) operator(+=) integer(1) keyword(if) ident(count)operator(==)integer(4)operator(:) @@ -3463,7 +3463,7 @@ keyword(for) ident(line) keyword(in) ident(myfile)operator(:) comment(##-----------------------------) comment(# If you need to extract ranges a lot, the following generator funcs) comment(# may be useful:) -keyword(def) ident(extract_range)operator(()ident(myfile)operator(,) ident(start)operator(,) ident(finish)operator(\))operator(:) +keyword(def) method(extract_range)operator(()ident(myfile)operator(,) ident(start)operator(,) ident(finish)operator(\))operator(:) keyword(for) ident(i)operator(,) ident(line) keyword(in) predefined(enumerate)operator(()ident(myfile)operator(\))operator(:) keyword(if) ident(start) operator(<=) ident(i) operator(<) ident(finish)operator(:) keyword(yield) ident(line) @@ -3473,7 +3473,7 @@ keyword(def) ident(extract_range)operator(()ident(myfile)operator(,) ident(start keyword(for) ident(line) keyword(in) ident(extract_range)operator(()predefined(open)operator(()string<delimiter(")content(/etc/passwd)delimiter(")>operator(\))operator(,) integer(3)operator(,) integer(5)operator(\))operator(:) keyword(print) ident(line) -keyword(def) ident(patterned_range)operator(()ident(myfile)operator(,) ident(startpat)operator(,) ident(endpat)operator(=)pre_constant(None)operator(\))operator(:) +keyword(def) method(patterned_range)operator(()ident(myfile)operator(,) ident(startpat)operator(,) ident(endpat)operator(=)pre_constant(None)operator(\))operator(:) ident(startpat) operator(=) ident(re)operator(.)ident(compile)operator(()ident(startpat)operator(\)) keyword(if) ident(endpat) keyword(is) keyword(not) pre_constant(None)operator(:) ident(endpat) operator(=) ident(re)operator(.)ident(compile)operator(()ident(endpat)operator(\)) @@ -3505,7 +3505,7 @@ comment(# The book uses "\\Q" which escapes any characters that would otherwise comment(# treated as regular expression.) comment(# Escaping every char fails as "\\s" is not "s" in a regex.) -keyword(def) ident(glob2pat)operator(()ident(globstr)operator(\))operator(:) +keyword(def) method(glob2pat)operator(()ident(globstr)operator(\))operator(:) ident(pat) operator(=) ident(globstr)operator(.)ident(replace)operator(()string<delimiter(")char(\\\\)delimiter(")>operator(,)string<modifier(r)delimiter(")content(\\\\)delimiter(")>operator(\)) ident(pat) operator(=) ident(pat)operator(.)ident(replace)operator(()string<delimiter(")content(.)delimiter(")>operator(,)string<modifier(r)delimiter(")content(\\.)delimiter(")>operator(\))operator(.)ident(replace)operator(()string<delimiter(")content(?)delimiter(")>operator(,)string<modifier(r)delimiter(")content(.)delimiter(")>operator(\))operator(.)ident(replace)operator(()string<delimiter(")content(*)delimiter(")>operator(,)string<modifier(r)delimiter(")content(.*)delimiter(")>operator(\)) @@ -3571,20 +3571,20 @@ comment(# grepauth - print lines that mention both Tom and Nat) keyword(import) ident(fileinput) keyword(import) ident(re) -keyword(def) ident(build_match_any)operator(()ident(words)operator(\))operator(:) +keyword(def) method(build_match_any)operator(()ident(words)operator(\))operator(:) keyword(return) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content(|)delimiter(")>operator(.)ident(join)operator(()ident(words)operator(\))operator(\)) -keyword(def) ident(uniq)operator(()ident(arr)operator(\))operator(:) +keyword(def) method(uniq)operator(()ident(arr)operator(\))operator(:) ident(seen) operator(=) operator({)operator(}) keyword(for) ident(item) keyword(in) ident(arr)operator(:) ident(seen)operator([)ident(item)operator(]) operator(=) ident(seen)operator(.)ident(get)operator(()ident(item)operator(,) integer(0)operator(\)) operator(+) integer(1) keyword(return) ident(seen)operator(.)ident(keys)operator(()operator(\)) -keyword(def) ident(build_match_all)operator(()ident(words)operator(\))operator(:) +keyword(def) method(build_match_all)operator(()ident(words)operator(\))operator(:) ident(r) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content(|)delimiter(")>operator(.)ident(join)operator(()ident(words)operator(\))operator(\)) ident(c) operator(=) keyword(lambda) ident(line)operator(:) predefined(len)operator(()ident(uniq)operator(()ident(r)operator(.)ident(findall)operator(()ident(line)operator(\))operator(\))operator(\))operator(>=)predefined(len)operator(()ident(words)operator(\)) keyword(return) ident(c) -predefined(any) operator(=) ident(build_match_any)operator(()operator(()string<delimiter(")content(Tom)delimiter(")>operator(,)string<delimiter(")content(Nat)delimiter(")>operator(\))operator(\)) -predefined(all) operator(=) ident(build_match_all)operator(()operator(()string<delimiter(")content(Tom)delimiter(")>operator(,)string<delimiter(")content(Nat)delimiter(")>operator(\))operator(\)) +ident(any) operator(=) ident(build_match_any)operator(()operator(()string<delimiter(")content(Tom)delimiter(")>operator(,)string<delimiter(")content(Nat)delimiter(")>operator(\))operator(\)) +ident(all) operator(=) ident(build_match_all)operator(()operator(()string<delimiter(")content(Tom)delimiter(")>operator(,)string<delimiter(")content(Nat)delimiter(")>operator(\))operator(\)) keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:) keyword(if) predefined(any)operator(.)ident(search)operator(()ident(line)operator(\))operator(:) keyword(print) string<delimiter(")content(any:)delimiter(")>operator(,) ident(line) @@ -3610,7 +3610,7 @@ keyword(while) pre_constant(True)operator(:) keyword(break) comment(# ----) -keyword(def) ident(is_valid_pattern)operator(()ident(pat)operator(\))operator(:) +keyword(def) method(is_valid_pattern)operator(()ident(pat)operator(\))operator(:) keyword(try)operator(:) ident(re)operator(.)ident(compile)operator(()ident(pat)operator(\)) keyword(except) ident(re)operator(.)ident(error)operator(:) @@ -3806,7 +3806,7 @@ keyword(try)operator(:) keyword(except) exception(AttributeError)operator(:) keyword(print) predefined(len)operator(()ident(n)operator(\)) comment(##-----------------------------) -keyword(def) ident(diaphantine)operator(()ident(n)operator(,) ident(x)operator(,) ident(y)operator(,) ident(z)operator(\))operator(:) +keyword(def) method(diaphantine)operator(()ident(n)operator(,) ident(x)operator(,) ident(y)operator(,) ident(z)operator(\))operator(:) ident(pat) operator(=) string<modifier(r)delimiter(")content(^(o*\))content(\\1)content({%s}(o*\))content(\\2)content({%s}(o*\))content(\\3)content({%s}$)delimiter(")>operator(%)operator(()ident(x)operator(-)integer(1)operator(,) ident(y)operator(-)integer(1)operator(,) ident(z)operator(-)integer(1)operator(\)) ident(text) operator(=) string<delimiter(")content(o)delimiter(")>operator(*)ident(n) keyword(try)operator(:) @@ -3928,7 +3928,7 @@ comment(##-----------------------------) comment(# Assuming the strings all start with different letters, or you don't) comment(# mind there being precedence, use the startswith string method:) -keyword(def) ident(get_action)operator(()ident(answer)operator(\))operator(:) +keyword(def) method(get_action)operator(()ident(answer)operator(\))operator(:) ident(answer) operator(=) ident(answer)operator(.)ident(lower)operator(()operator(\)) ident(actions) operator(=) operator([)string<delimiter(")content(send)delimiter(")>operator(,) string<delimiter(")content(stop)delimiter(")>operator(,) string<delimiter(")content(abort)delimiter(")>operator(,) string<delimiter(")content(list)delimiter(")>operator(,) string<delimiter(")content(end)delimiter(")>operator(]) keyword(for) ident(action) keyword(in) ident(actions)operator(:) @@ -3947,7 +3947,7 @@ keyword(for) ident(action) keyword(in) operator(()string<delimiter(")content(SEN keyword(print) string<delimiter(")content(Action is %s.)delimiter(")>operator(%)ident(action)operator(.)ident(lower)operator(()operator(\)) comment(##-----------------------------) keyword(import) ident(re)operator(,) ident(sys) -keyword(def) ident(handle_cmd)operator(()ident(cmd)operator(\))operator(:) +keyword(def) method(handle_cmd)operator(()ident(cmd)operator(\))operator(:) ident(cmd) operator(=) ident(re)operator(.)ident(escape)operator(()ident(cmd)operator(.)ident(strip)operator(()operator(\))operator(\)) keyword(for) ident(name)operator(,) ident(action) keyword(in) operator({)string<delimiter(")content(edit)delimiter(")>operator(:) ident(invoke_editor)operator(,) string<delimiter(")content(send)delimiter(")>operator(:) ident(deliver_message)operator(,) @@ -3966,13 +3966,13 @@ comment(##-----------------------------) comment(# urlify - wrap HTML links around URL-like constructs) keyword(import) ident(re)operator(,) ident(sys)operator(,) ident(fileinput) -keyword(def) ident(urlify_string)operator(()ident(s)operator(\))operator(:) +keyword(def) method(urlify_string)operator(()ident(s)operator(\))operator(:) ident(urls) operator(=) string<modifier(r)delimiter(')content((http|telnet|gopher|file|wais|ftp\))delimiter(')> ident(ltrs) operator(=) string<modifier(r)delimiter(')content(\\w)delimiter(')>operator(;) ident(gunk) operator(=) string<modifier(r)delimiter(')content(/#~:.?+=&%@!)content(\\-)delimiter(')> ident(punc) operator(=) string<modifier(r)delimiter(')content(.:?)content(\\-)delimiter(')> - predefined(any) operator(=) ident(ltrs) operator(+) ident(gunk) operator(+) ident(punc) + ident(any) operator(=) ident(ltrs) operator(+) ident(gunk) operator(+) ident(punc) ident(pat) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(""")content( )content( )content(\\b)content( # start at word boundary)content( @@ -4053,12 +4053,12 @@ keyword(print) ident(re)operator(.)ident(sub)operator(()string<delimiter(")conte comment(##-----------------------------) keyword(import) ident(re) -keyword(def) ident(unescape_hex)operator(()ident(matchobj)operator(\))operator(:) +keyword(def) method(unescape_hex)operator(()ident(matchobj)operator(\))operator(:) keyword(return) predefined(chr)operator(()predefined(int)operator(()ident(matchobj)operator(.)ident(groups)operator(()integer(0)operator(\))operator([)integer(0)operator(])operator(,) integer(16)operator(\))operator(\)) ident(txt) operator(=) ident(re)operator(.)ident(sub)operator(()string<modifier(r)delimiter(")content(%([0-9A-Fa-f][0-9A-Fa-f]\))delimiter(")>operator(,) ident(unescape_hex)operator(,) ident(txt)operator(\)) comment(# Assuming that the hex escaping is well-behaved, an alternative is:) -keyword(def) ident(unescape_hex)operator(()ident(seg)operator(\))operator(:) +keyword(def) method(unescape_hex)operator(()ident(seg)operator(\))operator(:) keyword(return) predefined(chr)operator(()predefined(int)operator(()ident(seg)operator([)operator(:)integer(2)operator(])operator(,) integer(16)operator(\))operator(\)) operator(+) ident(seg)operator([)integer(2)operator(:)operator(]) ident(segs) operator(=) ident(txt)operator(.)ident(split)operator(()string<delimiter(")content(%)delimiter(")>operator(\)) @@ -4362,7 +4362,7 @@ keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)oper comment(#-----------------------------) keyword(import) ident(sys) -keyword(def) ident(do_with)operator(()ident(myfile)operator(\))operator(:) +keyword(def) method(do_with)operator(()ident(myfile)operator(\))operator(:) keyword(for) ident(line) keyword(in) ident(myfile)operator(:) keyword(print) ident(line)operator([)operator(:)operator(-)integer(1)operator(]) @@ -4621,7 +4621,7 @@ comment(# @@INCOMPLETE@@) comment(# @@PLEAC@@_7.16) comment(# NOTE: this is all much easier in Python) -keyword(def) ident(subroutine)operator(()ident(myfile)operator(\))operator(:) +keyword(def) method(subroutine)operator(()ident(myfile)operator(\))operator(:) keyword(print)operator(>>)ident(myfile)operator(,) string<delimiter(")content(Hello, file)delimiter(")> ident(variable) operator(=) ident(myfile) @@ -4637,7 +4637,7 @@ keyword(for) ident(myfile) keyword(in) ident(files)operator(:) comment(# NOTE: This is unix specific) keyword(import) ident(os) -predefined(file) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(tee file1 file2 file3 >/dev/null)delimiter(")>operator(,) string<delimiter(")content(w)delimiter(")>operator(\)) +ident(file) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(tee file1 file2 file3 >/dev/null)delimiter(")>operator(,) string<delimiter(")content(w)delimiter(")>operator(\)) keyword(print)operator(>>)ident(myfile)operator(,) string<delimiter(")content(whatever)delimiter(")> comment(# NOTE: the "make STDOUT go to three files" is bad programming style) @@ -4647,15 +4647,15 @@ keyword(print) string<delimiter(")content(whatever)delimiter(")> ident(sys)operator(.)ident(stdout)operator(.)ident(close)operator(()operator(\)) comment(# You could use a utility object to redirect writes:) -keyword(class) ident(FileDispatcher)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(files)operator(\))operator(:) +keyword(class) class(FileDispatcher)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(files)operator(\))operator(:) pre_constant(self)operator(.)ident(files) operator(=) ident(files) - keyword(def) ident(write)operator(()pre_constant(self)operator(,) ident(msg)operator(\))operator(:) + keyword(def) method(write)operator(()pre_constant(self)operator(,) ident(msg)operator(\))operator(:) keyword(for) ident(f) keyword(in) pre_constant(self)operator(.)ident(files)operator(:) ident(f)operator(.)ident(write)operator(()ident(msg)operator(\)) - keyword(def) ident(close)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(close)operator(()pre_constant(self)operator(\))operator(:) keyword(for) ident(f) keyword(in) pre_constant(self)operator(.)ident(files)operator(:) ident(f)operator(.)ident(close)operator(()operator(\)) @@ -4746,7 +4746,7 @@ comment(#-----------------------------) keyword(print)operator(>>)ident(myfile)operator(,) string<delimiter(")content(One)delimiter(")>operator(,) string<delimiter(")content(two)delimiter(")>operator(,) string<delimiter(")content(three)delimiter(")> comment(# "One two three") keyword(print) string<delimiter(")content(Baa baa black sheep.)delimiter(")> comment(# Sent to default output file) comment(#-----------------------------) -predefined(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()integer(4096)operator(\)) +ident(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()integer(4096)operator(\)) ident(rv) operator(=) predefined(len)operator(()predefined(buffer)operator(\)) comment(#-----------------------------) ident(myfile)operator(.)ident(truncate)operator(()ident(length)operator(\)) @@ -4768,7 +4768,7 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_8.1) -keyword(def) ident(ContReader)operator(()ident(infile)operator(\))operator(:) +keyword(def) method(ContReader)operator(()ident(infile)operator(\))operator(:) ident(lines) operator(=) operator([)operator(]) keyword(for) ident(line) keyword(in) ident(infile)operator(:) ident(line) operator(=) ident(line)operator(.)ident(rstrip)operator(()operator(\)) @@ -4821,7 +4821,7 @@ keyword(while) ident(fi)operator(.)ident(readline)operator(()operator(\))operato ident(count) operator(=) ident(fi)operator(.)ident(lineno)operator(()operator(\)) comment(#-----------------------------) -keyword(def) ident(SepReader)operator(()ident(infile)operator(,) ident(sep) operator(=) string<delimiter(")char(\\n)char(\\n)delimiter(")>operator(\))operator(:) +keyword(def) method(SepReader)operator(()ident(infile)operator(,) ident(sep) operator(=) string<delimiter(")char(\\n)char(\\n)delimiter(")>operator(\))operator(:) ident(text) operator(=) ident(infile)operator(.)ident(read)operator(()integer(10000)operator(\)) keyword(if) keyword(not) ident(text)operator(:) keyword(return) @@ -5073,7 +5073,7 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_8.12) ident(address) operator(=) ident(recsize) operator(*) ident(recno) ident(myfile)operator(.)ident(seek)operator(()ident(address)operator(,) integer(0)operator(\)) -predefined(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()ident(recsize)operator(\)) +ident(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()ident(recsize)operator(\)) comment(#-----------------------------) ident(address) operator(=) ident(recsize) operator(*) operator(()ident(recno)operator(-)integer(1)operator(\)) comment(#-----------------------------) @@ -5084,7 +5084,7 @@ comment(# ^^PLEAC^^_8.13) keyword(import) ident(posixfile) ident(address) operator(=) ident(recsize) operator(*) ident(recno) ident(myfile)operator(.)ident(seek)operator(()ident(address)operator(\)) -predefined(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()ident(recsize)operator(\)) +ident(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()ident(recsize)operator(\)) comment(# ... work with the buffer, then turn it back into a string and ...) ident(myfile)operator(.)ident(seek)operator(()operator(-)ident(recsize)operator(,) ident(posixfile)operator(.)ident(SEEK_CUR)operator(\)) ident(myfile)operator(.)ident(write)operator(()predefined(buffer)operator(\)) @@ -5191,7 +5191,7 @@ keyword(if) ident(info)operator(.)ident(st_atime) operator(>) ident(info)operato keyword(print) ident(filename)operator(,) string<delimiter(")content(has been read since it was written.)delimiter(")> comment(#-----------------------------) keyword(import) ident(os) -keyword(def) ident(is_safe)operator(()ident(path)operator(\))operator(:) +keyword(def) method(is_safe)operator(()ident(path)operator(\))operator(:) ident(info) operator(=) ident(os)operator(.)ident(stat)operator(()ident(path)operator(\)) comment(# owner neither superuser nor me ) @@ -5211,7 +5211,7 @@ keyword(def) ident(is_safe)operator(()ident(path)operator(\))operator(:) comment(#-----------------------------) comment(## XXX What is '_PC_CHOWN_RESTRICTED'?) -keyword(def) ident(is_verysafe)operator(()ident(path)operator(\))operator(:) +keyword(def) method(is_verysafe)operator(()ident(path)operator(\))operator(:) ident(terms) operator(=) operator([)operator(]) keyword(while) pre_constant(True)operator(:) ident(path)operator(,) ident(ending) operator(=) ident(os)operator(.)ident(path)operator(.)ident(split)operator(()ident(path)operator(\)) @@ -5270,15 +5270,15 @@ keyword(import) ident(time) keyword(import) ident(struct) keyword(import) ident(os) -keyword(class) ident(WTmpRecord)operator(:) +keyword(class) class(WTmpRecord)operator(:) ident(fmt) operator(=) string<delimiter(")content(hI32s4s32s256siili4l20s)delimiter(")>operator(;) ident(_fieldnames) operator(=) operator([)string<delimiter(")content(type)delimiter(")>operator(,)string<delimiter(")content(PID)delimiter(")>operator(,)string<delimiter(")content(Line)delimiter(")>operator(,)string<delimiter(")content(inittab)delimiter(")>operator(,)string<delimiter(")content(User)delimiter(")>operator(,)string<delimiter(")content(Hostname)delimiter(")>operator(,) string<delimiter(")content(exit_status)delimiter(")>operator(,) string<delimiter(")content(session)delimiter(")>operator(,) string<delimiter(")content(time)delimiter(")>operator(,) string<delimiter(")content(addr)delimiter(")> operator(]) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(_rec_size) operator(=) ident(struct)operator(.)ident(calcsize)operator(()pre_constant(self)operator(.)ident(fmt)operator(\)) - keyword(def) ident(size)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(size)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_rec_size) - keyword(def) ident(unpack)operator(()pre_constant(self)operator(,) ident(bin_data)operator(\))operator(:) + keyword(def) method(unpack)operator(()pre_constant(self)operator(,) ident(bin_data)operator(\))operator(:) ident(rec) operator(=) ident(struct)operator(.)ident(unpack)operator(()pre_constant(self)operator(.)ident(fmt)operator(,) ident(bin_data)operator(\)) pre_constant(self)operator(.)ident(_rec) operator(=) operator([)operator(]) keyword(for) ident(i) keyword(in) predefined(range)operator(()predefined(len)operator(()ident(rec)operator(\))operator(\))operator(:) @@ -5288,9 +5288,9 @@ keyword(class) ident(WTmpRecord)operator(:) keyword(else)operator(:) pre_constant(self)operator(.)ident(_rec)operator(.)ident(append)operator(()ident(rec)operator([)ident(i)operator(])operator(\)) keyword(return) pre_constant(self)operator(.)ident(_rec) - keyword(def) ident(fieldnames)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(fieldnames)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_fieldnames) - keyword(def) ident(__getattr__)operator(()pre_constant(self)operator(,)ident(name)operator(\))operator(:) + keyword(def) method(__getattr__)operator(()pre_constant(self)operator(,)ident(name)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_rec)operator([)pre_constant(self)operator(.)ident(_fieldnames)operator(.)ident(index)operator(()ident(name)operator(\))operator(]) ident(rec) operator(=) ident(WTmpRecord)operator(()operator(\)) @@ -5298,7 +5298,7 @@ ident(f) operator(=) predefined(open)operator(()string<delimiter(")content(/var/ ident(f)operator(.)ident(seek)operator(()integer(0)operator(,)integer(2)operator(\)) keyword(while) pre_constant(True)operator(:) keyword(while) pre_constant(True)operator(:) - predefined(bin) operator(=) ident(f)operator(.)ident(read)operator(()ident(rec)operator(.)ident(size)operator(()operator(\))operator(\)) + ident(bin) operator(=) ident(f)operator(.)ident(read)operator(()ident(rec)operator(.)ident(size)operator(()operator(\))operator(\)) keyword(if) predefined(len)operator(()predefined(bin)operator(\)) operator(!=) ident(rec)operator(.)ident(size)operator(()operator(\))operator(:) keyword(break) ident(rec)operator(.)ident(unpack)operator(()predefined(bin)operator(\)) @@ -5338,7 +5338,7 @@ keyword(for) ident(user) keyword(in) ident(sys)operator(.)ident(argv)operator([) keyword(print) string<delimiter(")content(no such uid %s)delimiter(")> operator(%) operator(()ident(user)operator(\)) keyword(continue) ident(f)operator(.)ident(seek)operator(()ident(rec_size) operator(*) ident(user_id)operator(\)) - predefined(bin) operator(=) ident(f)operator(.)ident(read)operator(()ident(rec_size)operator(\)) + ident(bin) operator(=) ident(f)operator(.)ident(read)operator(()ident(rec_size)operator(\)) keyword(if) predefined(len)operator(()predefined(bin)operator(\)) operator(==) ident(rec_size)operator(:) ident(data) operator(=) ident(struct)operator(.)ident(unpack)operator(()ident(fmt)operator(,) predefined(bin)operator(\)) keyword(if) ident(data)operator([)integer(0)operator(])operator(:) @@ -5480,7 +5480,7 @@ comment(#-----------------------------) keyword(import) ident(os) ident(seen) operator(=) operator({)operator(}) -keyword(def) ident(do_my_thing)operator(()ident(filename)operator(\))operator(:) +keyword(def) method(do_my_thing)operator(()ident(filename)operator(\))operator(:) ident(fstat) operator(=) ident(os)operator(.)ident(stat)operator(()ident(filename)operator(\)) ident(key) operator(=) operator(()ident(fstat)operator(.)ident(st_ino)operator(,) ident(fstat)operator(.)ident(st_dev)operator(\)) keyword(if) keyword(not) ident(seen)operator(.)ident(get)operator(()ident(key)operator(\))operator(:) @@ -5622,9 +5622,9 @@ ident(shutil)operator(.)ident(rmtree)operator(()ident(path)operator(\)) comment(# DON'T DO THIS:) keyword(import) ident(os)operator(,) ident(sys) -keyword(def) ident(DeleteDir)operator(()predefined(dir)operator(\))operator(:) +keyword(def) method(DeleteDir)operator(()predefined(dir)operator(\))operator(:) keyword(for) ident(name) keyword(in) ident(os)operator(.)ident(listdir)operator(()predefined(dir)operator(\))operator(:) - predefined(file) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()predefined(dir)operator(,) ident(name)operator(\)) + ident(file) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()predefined(dir)operator(,) ident(name)operator(\)) keyword(if) keyword(not) ident(os)operator(.)ident(path)operator(.)ident(islink)operator(()predefined(file)operator(\)) keyword(and) ident(os)operator(.)ident(path)operator(.)ident(isdir)operator(()predefined(file)operator(\))operator(:) ident(DeleteDir)operator(()predefined(file)operator(\)) keyword(else)operator(:) @@ -5650,7 +5650,7 @@ comment(# use os.renames if newname needs directory creation.) comment(#A vaguely Pythonic solution is:) keyword(import) ident(glob) -keyword(def) ident(rename)operator(()ident(files)operator(,) ident(transfunc)operator(\)) +keyword(def) method(rename)operator(()ident(files)operator(,) ident(transfunc)operator(\)) keyword(for) ident(fname) keyword(in) ident(fnames)operator(:) ident(newname) operator(=) ident(transfunc)operator(()ident(fname)operator(\)) keyword(try)operator(:) @@ -5659,25 +5659,25 @@ keyword(def) ident(rename)operator(()ident(files)operator(,) ident(transfunc)ope keyword(print) string<delimiter(")content(Couldn't rename %s to %s: %s!)delimiter(")> operator(%) \ operator(()ident(fname)operator(,) ident(newfile)operator(,) ident(err)operator(\)) -keyword(def) ident(transfunc)operator(()ident(fname)operator(\))operator(:) +keyword(def) method(transfunc)operator(()ident(fname)operator(\))operator(:) keyword(return) ident(fname)operator([)operator(:)operator(-)integer(5)operator(]) ident(rename)operator(()ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*.orig)delimiter(")>operator(\))operator(,) ident(transfunc)operator(\)) -keyword(def) ident(transfunc)operator(()ident(fname)operator(\))operator(:) +keyword(def) method(transfunc)operator(()ident(fname)operator(\))operator(:) keyword(return) ident(fname)operator(.)ident(lower)operator(()operator(\)) ident(rename)operator(()operator([)ident(f) keyword(for) ident(f) keyword(in) ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*)delimiter(")>operator(\)) keyword(if) keyword(not) ident(f)operator(.)ident(startswith)operator(()string<delimiter(")content(Make\)], transfunc\) )>error() -keyword(def) ident(transfunc)operator(()ident(fname)operator(\))operator(:) +keyword(def) method(transfunc)operator(()ident(fname)operator(\))operator(:) keyword(return) ident(fname) operator(+) string<delimiter(")content(.bad)delimiter(")> ident(rename)operator(()ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*.f)delimiter(")>operator(\))operator(,) ident(transfunc)operator(\)) -keyword(def) ident(transfunc)operator(()ident(fname)operator(\))operator(:) +keyword(def) method(transfunc)operator(()ident(fname)operator(\))operator(:) ident(answer) operator(=) predefined(raw_input)operator(()ident(fname) operator(+) string<delimiter(")content(: )delimiter(")>operator(\)) keyword(if) ident(answer)operator(.)ident(upper)operator(()operator(\))operator(.)ident(startswith)operator(()string<delimiter(")content(Y)delimiter(")>operator(\))operator(:) keyword(return) ident(fname)operator(.)ident(replace)operator(()string<delimiter(")content(foo)delimiter(")>operator(,) string<delimiter(")content(bar)delimiter(")>operator(\)) ident(rename)operator(()ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*)delimiter(")>operator(\))operator(,) ident(transfunc)operator(\)) -keyword(def) ident(transfunc)operator(()ident(fname)operator(\))operator(:) +keyword(def) method(transfunc)operator(()ident(fname)operator(\))operator(:) keyword(return) string<delimiter(")content(.#)delimiter(")> operator(+) ident(fname)operator([)operator(:)operator(-)integer(1)operator(]) ident(rename)operator(()ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(/tmp/*~)delimiter(")>operator(\))operator(,) ident(transfunc)operator(\)) @@ -5721,7 +5721,7 @@ keyword(print) string<delimiter(")content(dir is %s, name is %s, extension is %s comment(# dir is Hard%20Drive:System%20Folder, name is README, extension is .txt) comment(#-----------------------------) comment(# DON'T DO THIS - it's not portable.) -keyword(def) ident(extension)operator(()ident(path)operator(\))operator(:) +keyword(def) method(extension)operator(()ident(path)operator(\))operator(:) ident(pos) operator(=) ident(path)operator(.)ident(find)operator(()string<delimiter(")content(.)delimiter(")>operator(\)) keyword(if) ident(pos) operator(==) operator(-)integer(1)operator(:) keyword(return) string<delimiter(")delimiter(")> @@ -5758,7 +5758,7 @@ comment(# fix relative paths) ident(srcdir) operator(=) ident(os)operator(.)ident(path)operator(.)ident(abspath)operator(()ident(srcdir)operator(\)) ident(dstdir) operator(=) ident(os)operator(.)ident(path)operator(.)ident(abspath)operator(()ident(dstdir)operator(\)) -keyword(def) ident(wanted)operator(()ident(arg)operator(,) ident(dirname)operator(,) ident(names)operator(\))operator(:) +keyword(def) method(wanted)operator(()ident(arg)operator(,) ident(dirname)operator(,) ident(names)operator(\))operator(:) keyword(for) ident(direntry) keyword(in) ident(names)operator(:) ident(relname) operator(=) string<delimiter(")content(%s/%s)delimiter(")> operator(%) operator(()ident(dirname)operator(,) ident(direntry)operator(\)) keyword(if) ident(os)operator(.)ident(path)operator(.)ident(isdir)operator(()ident(relname)operator(\))operator(:) @@ -5785,7 +5785,7 @@ comment(# ^^PLEAC^^_10.0) comment(#-----------------------------) comment(# DO NOT DO THIS...) ident(greeted) operator(=) integer(0) -keyword(def) ident(hello)operator(()operator(\))operator(:) +keyword(def) method(hello)operator(()operator(\))operator(:) keyword(global) ident(greeted) ident(greeted) operator(+=) integer(1) keyword(print) string<delimiter(")content(hi there)delimiter(")> @@ -5806,7 +5806,7 @@ comment(# ^^PLEAC^^_10.1) comment(#-----------------------------) keyword(import) ident(math) comment(# Provided for demonstration purposes only. Use math.hypot(\) instead.) -keyword(def) ident(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\))operator(:) +keyword(def) method(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\))operator(:) keyword(return) ident(math)operator(.)ident(sqrt)operator(()ident(side1)operator(**)integer(2) operator(+) ident(side2)operator(**)integer(2)operator(\)) ident(diag) operator(=) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) comment(# diag is 5.0) @@ -5821,7 +5821,7 @@ comment(#-----------------------------) ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) comment(# Provided for demonstration purposes only. Use:) comment(# ints = [int(num\) for num in nums] ) -keyword(def) ident(int_all)operator(()ident(nums)operator(\))operator(:) +keyword(def) method(int_all)operator(()ident(nums)operator(\))operator(:) ident(retlist) operator(=) operator([)operator(]) comment(# make new list for return) keyword(for) ident(n) keyword(in) ident(nums)operator(:) ident(retlist)operator(.)ident(append)operator(()predefined(int)operator(()ident(n)operator(\))operator(\)) @@ -5830,7 +5830,7 @@ ident(ints) operator(=) ident(int_all)operator(()ident(nums)operator(\)) comment(#-----------------------------) ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -keyword(def) ident(trunc_em)operator(()ident(nums)operator(\))operator(:) +keyword(def) method(trunc_em)operator(()ident(nums)operator(\))operator(:) keyword(for) ident(i)operator(,)ident(elem) keyword(in) predefined(enumerate)operator(()ident(nums)operator(\))operator(:) ident(nums)operator([)ident(i)operator(]) operator(=) predefined(int)operator(()ident(elem)operator(\)) ident(trunc_em)operator(()ident(nums)operator(\)) comment(# nums now [1,3,6]) @@ -5852,7 +5852,7 @@ comment(# Using global variables is discouraged - by default variables) comment(# are visible only at and below the scope at which they are declared.) comment(# Global variables modified by a function or method must be declared ) comment(# using the "global" keyword if they are modified) -keyword(def) ident(somefunc)operator(()operator(\))operator(:) +keyword(def) method(somefunc)operator(()operator(\))operator(:) ident(variable) operator(=) ident(something) comment(# variable is invisible outside of somefunc) comment(#-----------------------------) keyword(import) ident(sys) @@ -5862,13 +5862,13 @@ comment(#-----------------------------) ident(a)operator(,) ident(b) operator(=) ident(pair) ident(c) operator(=) ident(fetch_time)operator(()operator(\)) -keyword(def) ident(check_x)operator(()ident(x)operator(\))operator(:) +keyword(def) method(check_x)operator(()ident(x)operator(\))operator(:) ident(y) operator(=) string<delimiter(")content(whatever)delimiter(")> ident(run_check)operator(()operator(\)) keyword(if) ident(condition)operator(:) keyword(print) string<delimiter(")content(got)delimiter(")>operator(,) ident(x) comment(#-----------------------------) -keyword(def) ident(save_list)operator(()operator(*)ident(args)operator(\))operator(:) +keyword(def) method(save_list)operator(()operator(*)ident(args)operator(\))operator(:) ident(Global_List)operator(.)ident(extend)operator(()ident(args)operator(\)) comment(#-----------------------------) @@ -5881,13 +5881,13 @@ comment(# my $counter;) comment(# sub next_counter { return ++$counter }) comment(#}) comment(## is:) -keyword(def) ident(next_counter)operator(()ident(counter)operator(=)operator([)integer(0)operator(])operator(\))operator(:) comment(# default lists are created once only.) +keyword(def) method(next_counter)operator(()ident(counter)operator(=)operator([)integer(0)operator(])operator(\))operator(:) comment(# default lists are created once only.) ident(counter)operator([)integer(0)operator(]) operator(+=) integer(1) keyword(return) ident(counter)operator([)integer(0)operator(]) comment(# As that's a little tricksy (and can't make more than one counter\),) comment(# many Pythonistas would prefer either:) -keyword(def) ident(make_counter)operator(()operator(\))operator(:) +keyword(def) method(make_counter)operator(()operator(\))operator(:) ident(counter) operator(=) integer(0) keyword(while) pre_constant(True)operator(:) ident(counter) operator(+=) integer(1) @@ -5895,10 +5895,10 @@ keyword(def) ident(make_counter)operator(()operator(\))operator(:) ident(next_counter) operator(=) ident(make_counter)operator(()operator(\))operator(.)ident(next) comment(# Or:) -keyword(class) ident(Counter)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Counter)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(counter) operator(=) integer(0) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(counter) operator(+=) integer(1) keyword(return) pre_constant(self)operator(.)ident(counter) ident(next_counter) operator(=) ident(Counter)operator(()operator(\)) @@ -5911,28 +5911,28 @@ comment(# sub next_counter { return ++$counter }) comment(# sub prev_counter { return --$counter }) comment(#}) comment(## is to use a list (to save the counter\) and closured functions:) -keyword(def) ident(make_counter)operator(()ident(start)operator(=)integer(0)operator(\))operator(:) +keyword(def) method(make_counter)operator(()ident(start)operator(=)integer(0)operator(\))operator(:) ident(counter) operator(=) operator([)ident(start)operator(]) - keyword(def) ident(next_counter)operator(()operator(\))operator(:) + keyword(def) method(next_counter)operator(()operator(\))operator(:) ident(counter)operator([)integer(0)operator(]) operator(+=) integer(1) keyword(return) ident(counter)operator([)integer(0)operator(]) - keyword(def) ident(prev_counter)operator(()operator(\))operator(:) + keyword(def) method(prev_counter)operator(()operator(\))operator(:) ident(counter)operator([)integer(0)operator(]) operator(-=) integer(1) keyword(return) ident(counter)operator([)integer(0)operator(]) keyword(return) ident(next_counter)operator(,) ident(prev_counter) ident(next_counter)operator(,) ident(prev_counter) operator(=) ident(make_counter)operator(()operator(\)) comment(## A clearer way uses a class:) -keyword(class) ident(Counter)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(start)operator(=)integer(0)operator(\))operator(:) +keyword(class) class(Counter)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(start)operator(=)integer(0)operator(\))operator(:) pre_constant(self)operator(.)ident(value) operator(=) ident(start) - keyword(def) predefined(next)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(next)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(value) operator(+=) integer(1) keyword(return) pre_constant(self)operator(.)ident(value) - keyword(def) ident(prev)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(prev)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(value) operator(-=) integer(1) keyword(return) pre_constant(self)operator(.)ident(value) - keyword(def) ident(__int__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__int__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(value) ident(counter) operator(=) ident(Counter)operator(()integer(42)operator(\)) @@ -5962,9 +5962,9 @@ comment(#-----------------------------) ident(me) operator(=) ident(whoami)operator(()operator(\)) ident(him) operator(=) ident(whowasi)operator(()operator(\)) -keyword(def) ident(whoami)operator(()operator(\))operator(:) +keyword(def) method(whoami)operator(()operator(\))operator(:) ident(sys)operator(.)ident(_getframe)operator(()integer(1)operator(\))operator(.)ident(f_code)operator(.)ident(co_name) -keyword(def) ident(whowasi)operator(()operator(\))operator(:) +keyword(def) method(whowasi)operator(()operator(\))operator(:) ident(sys)operator(.)ident(_getframe)operator(()integer(2)operator(\))operator(.)ident(f_code)operator(.)ident(co_name) comment(#-----------------------------) @@ -5975,7 +5975,7 @@ comment(# needs to be done to pass a list or a dict as a parameter.) ident(list_diff)operator(()ident(list1)operator(,) ident(list2)operator(\)) comment(#-----------------------------) comment(# Note: if one parameter to zip(\) is longer it will be truncated) -keyword(def) ident(add_vecpair)operator(()ident(x)operator(,) ident(y)operator(\))operator(:) +keyword(def) method(add_vecpair)operator(()ident(x)operator(,) ident(y)operator(\))operator(:) keyword(return) operator([)ident(x1)operator(+)ident(y1) keyword(for) ident(x1)operator(,) ident(y1) keyword(in) predefined(zip)operator(()ident(x)operator(,) ident(y)operator(\))operator(]) ident(a) operator(=) operator([)integer(1)operator(,) integer(2)operator(]) @@ -6000,7 +6000,7 @@ comment(# NB: it has been tested under Python 2.3.x and no guarantees can be giv comment(# that it works under any future Python version.) keyword(import) ident(inspect)operator(,)ident(dis) -keyword(def) ident(expecting)operator(()operator(\))operator(:) +keyword(def) method(expecting)operator(()operator(\))operator(:) string<delimiter(""")content(Return how many values the caller is expecting)delimiter(""")> ident(f) operator(=) ident(inspect)operator(.)ident(currentframe)operator(()operator(\))operator(.)ident(f_back)operator(.)ident(f_back) ident(bytecode) operator(=) ident(f)operator(.)ident(f_code)operator(.)ident(co_code) @@ -6013,7 +6013,7 @@ keyword(def) ident(expecting)operator(()operator(\))operator(:) keyword(return) integer(0) keyword(return) integer(1) -keyword(def) ident(cleverfunc)operator(()operator(\))operator(:) +keyword(def) method(cleverfunc)operator(()operator(\))operator(:) ident(howmany) operator(=) ident(expecting)operator(()operator(\)) keyword(if) ident(howmany) operator(==) integer(0)operator(:) keyword(print) string<delimiter(")content(return value discarded)delimiter(")> @@ -6038,7 +6038,7 @@ ident(thefunc)operator(()ident(start)operator(=) string<delimiter(")content(+5m) ident(thefunc)operator(()ident(finish)operator(=) string<delimiter(")content(+30m)delimiter(")>operator(\)) ident(thefunc)operator(()ident(start)operator(=)string<delimiter(")content(+5m)delimiter(")>operator(,) ident(increment)operator(=)string<delimiter(")content(15s)delimiter(")>operator(\)) comment(#-----------------------------) -keyword(def) ident(thefunc)operator(()ident(increment)operator(=)string<delimiter(')content(10s)delimiter(')>operator(,) +keyword(def) method(thefunc)operator(()ident(increment)operator(=)string<delimiter(')content(10s)delimiter(')>operator(,) ident(finish)operator(=)string<delimiter(')content(0)delimiter(')>operator(,) ident(start)operator(=)string<delimiter(')content(0)delimiter(')>operator(\))operator(:) keyword(if) ident(increment)operator(.)ident(endswith)operator(()string<delimiter(")content(m)delimiter(")>operator(\))operator(:) @@ -6053,7 +6053,7 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_10.9) comment(#-----------------------------) -keyword(def) ident(somefunc)operator(()operator(\))operator(:) +keyword(def) method(somefunc)operator(()operator(\))operator(:) ident(mylist) operator(=) operator([)operator(]) ident(mydict) operator(=) operator({)operator(}) comment(# ...) @@ -6061,7 +6061,7 @@ keyword(def) ident(somefunc)operator(()operator(\))operator(:) ident(mylist)operator(,) ident(mydict) operator(=) ident(somefunc)operator(()operator(\)) comment(#-----------------------------) -keyword(def) ident(fn)operator(()operator(\))operator(:) +keyword(def) method(fn)operator(()operator(\))operator(:) keyword(return) ident(a)operator(,) ident(b)operator(,) ident(c) comment(#-----------------------------) @@ -6076,13 +6076,13 @@ comment(#-----------------------------) comment(# Note: Exceptions are almost always preferred to error values) keyword(return) comment(#-----------------------------) -keyword(def) ident(empty_retval)operator(()operator(\))operator(:) +keyword(def) method(empty_retval)operator(()operator(\))operator(:) keyword(return) pre_constant(None) -keyword(def) ident(empty_retval)operator(()operator(\))operator(:) +keyword(def) method(empty_retval)operator(()operator(\))operator(:) keyword(return) comment(# identical to return None) -keyword(def) ident(empty_retval)operator(()operator(\))operator(:) +keyword(def) method(empty_retval)operator(()operator(\))operator(:) keyword(pass) comment(# None returned by default (empty func needs pass\)) comment(#-----------------------------) ident(a) operator(=) ident(yourfunc)operator(()operator(\)) @@ -6104,7 +6104,7 @@ comment(# only flatten lists (and convert dicts to named arguments\) if) comment(# explicitly told to do so. Python functions use named parameters) comment(# rather than shifting arguments:) -keyword(def) ident(myfunc)operator(()ident(a)operator(,) ident(b)operator(,) ident(c)operator(=)integer(4)operator(\))operator(:) +keyword(def) method(myfunc)operator(()ident(a)operator(,) ident(b)operator(,) ident(c)operator(=)integer(4)operator(\))operator(:) keyword(print) ident(a)operator(,) ident(b)operator(,) ident(c) ident(mylist) operator(=) operator([)integer(1)operator(,)integer(2)operator(]) @@ -6140,7 +6140,7 @@ ident(myfunc)operator(()ident(mylist)operator(,) ident(mydict1)operator(\)) comment(#=> [1, 2] {'c': 3, 'b': 2} 4) comment(# For demonstration purposes only - don't do this) -keyword(def) ident(mypush)operator(()ident(mylist)operator(,) operator(*)ident(vals)operator(\))operator(:) +keyword(def) method(mypush)operator(()ident(mylist)operator(,) operator(*)ident(vals)operator(\))operator(:) ident(mylist)operator(.)ident(extend)operator(()ident(vals)operator(\)) ident(mylist) operator(=) operator([)operator(]) @@ -6170,14 +6170,14 @@ keyword(try)operator(:) keyword(except)operator(:) ident(warnings)operator(.)ident(warn)operator(()string<delimiter(")content(func blew up: )delimiter(")> operator(+) predefined(str)operator(()ident(sys)operator(.)ident(exc_info)operator(()operator(\))operator([)integer(1)operator(])operator(\))operator(\)) comment(#-----------------------------) -keyword(class) ident(MoonPhaseError)operator(()exception(Exception)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(phase)operator(\))operator(:) +keyword(class) class(MoonPhaseError)operator(()exception(Exception)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(phase)operator(\))operator(:) pre_constant(self)operator(.)ident(phase) operator(=) ident(phase) -keyword(class) ident(FullMoonError)operator(()ident(MoonPhaseError)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(FullMoonError)operator(()ident(MoonPhaseError)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) ident(MoonPhaseError)operator(.)ident(__init__)operator(()string<delimiter(")content(full moon)delimiter(")>operator(\)) -keyword(def) ident(func)operator(()operator(\))operator(:) +keyword(def) method(func)operator(()operator(\))operator(:) keyword(raise) ident(FullMoonError)operator(()operator(\)) comment(# Ignore only FullMoonError exceptions) @@ -6200,21 +6200,21 @@ comment(# it's impossible to write your own. But then again, even in) comment(# Perl it's considered poor style.) comment(# DON'T DO THIS (You probably shouldn't use global variables anyway\):) -keyword(class) ident(Local)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(globalname)operator(,) ident(val)operator(\))operator(:) +keyword(class) class(Local)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(globalname)operator(,) ident(val)operator(\))operator(:) pre_constant(self)operator(.)ident(globalname) operator(=) ident(globalname) pre_constant(self)operator(.)ident(globalval) operator(=) predefined(globals)operator(()operator(\))operator([)ident(globalname)operator(]) predefined(globals)operator(()operator(\))operator([)ident(globalname)operator(]) operator(=) ident(val) - keyword(def) ident(__del__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__del__)operator(()pre_constant(self)operator(\))operator(:) predefined(globals)operator(()operator(\))operator([)pre_constant(self)operator(.)ident(globalname)operator(]) operator(=) pre_constant(self)operator(.)ident(globalval) ident(foo) operator(=) integer(4) -keyword(def) ident(blah)operator(()operator(\))operator(:) +keyword(def) method(blah)operator(()operator(\))operator(:) keyword(print) ident(foo) -keyword(def) ident(blech)operator(()operator(\))operator(:) +keyword(def) method(blech)operator(()operator(\))operator(:) ident(temp) operator(=) ident(Local)operator(()string<delimiter(")content(foo)delimiter(")>operator(,) integer(6)operator(\)) ident(blah)operator(()operator(\)) @@ -6241,24 +6241,24 @@ comment(#> <FONT COLOR='red'>careful here</FONT>) comment(#-----------------------------) comment(# Note: the 'text' should be HTML escaped if it can contain) comment(# any of the characters '<', '>' or '&') -keyword(def) ident(red)operator(()ident(text)operator(\))operator(:) +keyword(def) method(red)operator(()ident(text)operator(\))operator(:) keyword(return) string<delimiter(")content(<FONT COLOR='red'>)delimiter(")> operator(+) ident(text) operator(+) string<delimiter(")content(</FONT>)delimiter(")> comment(#-----------------------------) -keyword(def) ident(color_font)operator(()ident(color)operator(,) ident(text)operator(\))operator(:) +keyword(def) method(color_font)operator(()ident(color)operator(,) ident(text)operator(\))operator(:) keyword(return) string<delimiter(")content(<FONT COLOR='%s'>%s</FONT>)delimiter(")> operator(%) operator(()ident(color)operator(,) ident(text)operator(\)) -keyword(def) ident(red)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(red)delimiter(")>operator(,) ident(text)operator(\)) -keyword(def) ident(green)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(green)delimiter(")>operator(,) ident(text)operator(\)) -keyword(def) ident(blue)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(blue)delimiter(")>operator(,) ident(text)operator(\)) -keyword(def) ident(purple)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(purple)delimiter(")>operator(,) ident(text)operator(\)) +keyword(def) method(red)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(red)delimiter(")>operator(,) ident(text)operator(\)) +keyword(def) method(green)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(green)delimiter(")>operator(,) ident(text)operator(\)) +keyword(def) method(blue)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(blue)delimiter(")>operator(,) ident(text)operator(\)) +keyword(def) method(purple)operator(()ident(text)operator(\))operator(:) keyword(return) ident(color_font)operator(()string<delimiter(")content(purple)delimiter(")>operator(,) ident(text)operator(\)) comment(# etc) comment(#-----------------------------) comment(# This is done in Python by making an object, instead of) comment(# saving state in a local anonymous context.) -keyword(class) ident(ColorFont)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(color)operator(\))operator(:) +keyword(class) class(ColorFont)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(color)operator(\))operator(:) pre_constant(self)operator(.)ident(color) operator(=) ident(color) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(,) ident(text)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(,) ident(text)operator(\))operator(:) keyword(return) string<delimiter(")content(<FONT COLOR='%s'>%s</FONT>)delimiter(")> operator(%) operator(()pre_constant(self)operator(.)ident(color)operator(,) ident(text)operator(\)) ident(colors) operator(=) string<delimiter(")content(red blue green yellow orange purple violet)delimiter(")>operator(.)ident(split)operator(()string<delimiter(")content( )delimiter(")>operator(\)) @@ -6269,7 +6269,7 @@ comment(# If you really don't want to make a new class, you can) comment(# fake it somewhat by passing in default args.) ident(colors) operator(=) string<delimiter(")content(red blue green yellow orange purple violet)delimiter(")>operator(.)ident(split)operator(()string<delimiter(")content( )delimiter(")>operator(\)) keyword(for) ident(name) keyword(in) ident(colors)operator(:) - keyword(def) ident(temp)operator(()ident(text)operator(,) ident(color) operator(=) ident(name)operator(\))operator(:) + keyword(def) method(temp)operator(()ident(text)operator(,) ident(color) operator(=) ident(name)operator(\))operator(:) keyword(return) string<delimiter(")content(<FONT COLOR='%s'>%s</FONT>)delimiter(")> operator(%) operator(()ident(color)operator(,) ident(text)operator(\)) predefined(globals)operator(()operator(\))operator([)ident(name)operator(]) operator(=) ident(temp) @@ -6284,8 +6284,8 @@ comment(# here's how something similar would be done in Python. This) comment(# uses the ColorFont defined above.) comment(#-----------------------------) -keyword(class) ident(AnyColor)operator(:) - keyword(def) ident(__getattr__)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) +keyword(class) class(AnyColor)operator(:) + keyword(def) method(__getattr__)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) keyword(return) ident(ColorFont)operator(()ident(name)operator(\)) ident(colors) operator(=) ident(AnyColor)operator(()operator(\)) @@ -6305,9 +6305,9 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_10.16) comment(#-----------------------------) -keyword(def) ident(outer)operator(()ident(arg1)operator(\))operator(:) +keyword(def) method(outer)operator(()ident(arg1)operator(\))operator(:) ident(x) operator(=) ident(arg1) operator(+) integer(35) - keyword(def) ident(inner)operator(()operator(\))operator(:) + keyword(def) method(inner)operator(()operator(\))operator(:) keyword(return) ident(x) operator(*) integer(19) keyword(return) ident(x) operator(+) ident(inner)operator(()operator(\)) comment(#-----------------------------) @@ -6317,7 +6317,7 @@ comment(#-----------------------------) keyword(import) ident(mailbox)operator(,) ident(sys) ident(mbox) operator(=) ident(mailbox)operator(.)ident(PortableUnixMailbox)operator(()ident(sys)operator(.)ident(stdin)operator(\)) -keyword(def) ident(extract_data)operator(()ident(msg)operator(,) ident(idx)operator(\))operator(:) +keyword(def) method(extract_data)operator(()ident(msg)operator(,) ident(idx)operator(\))operator(:) ident(subject) operator(=) ident(msg)operator(.)ident(getheader)operator(()string<delimiter(")content(Subject)delimiter(")>operator(,) string<delimiter(")delimiter(")>operator(\))operator(.)ident(strip)operator(()operator(\)) keyword(if) ident(subject)operator([)operator(:)integer(3)operator(])operator(.)ident(lower)operator(()operator(\)) operator(==) string<delimiter(")content(re:)delimiter(")>operator(:) ident(subject) operator(=) ident(subject)operator([)integer(3)operator(:)operator(])operator(.)ident(lstrip)operator(()operator(\)) @@ -6332,7 +6332,7 @@ keyword(for) ident(subject)operator(,) ident(pos)operator(,) ident(msg)operator( comment(#-----------------------------) comment(# Sorts by subject then date then original position) -keyword(def) ident(subject_date_position)operator(()ident(elem)operator(\))operator(:) +keyword(def) method(subject_date_position)operator(()ident(elem)operator(\))operator(:) keyword(return) operator(()ident(elem)operator([)integer(0)operator(])operator(,) ident(elem)operator([)integer(2)operator(])operator(.)ident(getdate)operator(()string<delimiter(")content(Date)delimiter(")>operator(\))operator(,) ident(elem)operator([)integer(1)operator(])operator(\)) ident(messages)operator(.)ident(sort)operator(()ident(key)operator(=)ident(subject_date_position)operator(\)) @@ -6400,7 +6400,7 @@ ident(list_ref)operator(.)ident(sort)operator(()operator(\)) comment(#-----------------------------) ident(list_ref)operator(.)ident(append)operator(()ident(item)operator(\)) comment(#-----------------------------) -keyword(def) ident(list_ref)operator(()operator(\))operator(:) +keyword(def) method(list_ref)operator(()operator(\))operator(:) keyword(return) operator([)operator(]) ident(aref1) operator(=) ident(list_ref)operator(()operator(\)) @@ -6453,9 +6453,9 @@ ident(href) operator(=) predefined(hash) ident(anon_hash) operator(=) operator({) string<delimiter(")content(key1)delimiter(")>operator(:)string<delimiter(")content(value1)delimiter(")>operator(,) string<delimiter(")content(key2)delimiter(")> operator(:) string<delimiter(")content(value2 ...)delimiter(")> operator(}) ident(anon_hash_copy) operator(=) ident(anon_hash)operator(.)ident(copy)operator(()operator(\)) -predefined(hash) operator(=) ident(href) +ident(hash) operator(=) ident(href) ident(value) operator(=) ident(href)operator([)ident(key)operator(]) -predefined(slice) operator(=) operator([)ident(href)operator([)ident(k)operator(]) keyword(for) ident(k) keyword(in) operator(()ident(key1)operator(,) ident(key2)operator(,) ident(key3)operator(\))operator(]) +ident(slice) operator(=) operator([)ident(href)operator([)ident(k)operator(]) keyword(for) ident(k) keyword(in) operator(()ident(key1)operator(,) ident(key2)operator(,) ident(key3)operator(\))operator(]) ident(keys) operator(=) predefined(hash)operator(.)ident(keys)operator(()operator(\)) keyword(import) ident(types) @@ -6498,9 +6498,9 @@ keyword(if) ident(cmd) keyword(in) ident(commands)operator(:) keyword(else)operator(:) keyword(print) string<delimiter(")content(No such command: %s)delimiter(")> operator(%) ident(cmd) comment(#-----------------------------) -keyword(def) ident(counter_maker)operator(()operator(\))operator(:) +keyword(def) method(counter_maker)operator(()operator(\))operator(:) ident(start) operator(=) operator([)integer(0)operator(]) - keyword(def) ident(counter_function)operator(()operator(\))operator(:) + keyword(def) method(counter_function)operator(()operator(\))operator(:) comment(# start refers to the variable defined in counter_maker, but) comment(# we can't reassign or increment variables in parent scopes.) comment(# By using a one-element list we can modify the list without) @@ -6528,9 +6528,9 @@ comment(#=> 4) comment(#=> 5 0) comment(#-----------------------------) keyword(import) ident(time) -keyword(def) ident(timestamp)operator(()operator(\))operator(:) +keyword(def) method(timestamp)operator(()operator(\))operator(:) ident(start_time) operator(=) ident(time)operator(.)ident(time)operator(()operator(\)) - keyword(def) ident(elapsed)operator(()operator(\))operator(:) + keyword(def) method(elapsed)operator(()operator(\))operator(:) keyword(return) ident(time)operator(.)ident(time)operator(()operator(\)) operator(-) ident(start_time) keyword(return) ident(elapsed) ident(early) operator(=) ident(timestamp)operator(()operator(\)) @@ -6604,23 +6604,23 @@ keyword(print) string<delimiter(")content(last c1: %d)delimiter(")> operator(%) keyword(print) string<delimiter(")content(old c2: %d)delimiter(")> operator(%) ident(c2)operator([)string<delimiter(')content(reset)delimiter(')>operator(])operator(()operator(\)) comment(# 77) comment(#-----------------------------) comment(# DON'T DO THIS. Use an object instead ) -keyword(def) ident(mkcounter)operator(()ident(start)operator(\))operator(:) +keyword(def) method(mkcounter)operator(()ident(start)operator(\))operator(:) ident(count) operator(=) operator([)ident(start)operator(]) - keyword(def) predefined(next)operator(()operator(\))operator(:) + keyword(def) method(next)operator(()operator(\))operator(:) ident(count)operator([)integer(0)operator(]) operator(+=) integer(1) keyword(return) ident(count)operator([)integer(0)operator(]) - keyword(def) ident(prev)operator(()operator(\))operator(:) + keyword(def) method(prev)operator(()operator(\))operator(:) ident(count)operator([)integer(0)operator(]) operator(-=) integer(1) keyword(return) ident(count)operator([)integer(0)operator(]) - keyword(def) ident(get)operator(()operator(\))operator(:) + keyword(def) method(get)operator(()operator(\))operator(:) keyword(return) ident(count)operator([)integer(0)operator(]) - keyword(def) predefined(set)operator(()ident(value)operator(\))operator(:) + keyword(def) method(set)operator(()ident(value)operator(\))operator(:) ident(count)operator([)integer(0)operator(]) operator(=) ident(value) keyword(return) ident(count)operator([)integer(0)operator(]) - keyword(def) ident(bump)operator(()ident(incr)operator(\))operator(:) + keyword(def) method(bump)operator(()ident(incr)operator(\))operator(:) ident(count)operator([)integer(0)operator(]) operator(+=) ident(incr) keyword(return) ident(count)operator([)integer(0)operator(]) - keyword(def) ident(reset)operator(()operator(\))operator(:) + keyword(def) method(reset)operator(()operator(\))operator(:) ident(count)operator([)integer(0)operator(]) operator(=) ident(start) keyword(return) ident(count)operator([)integer(0)operator(]) keyword(return) operator({) @@ -6773,8 +6773,8 @@ comment(#=> [['0', '2', '3'], 4] [['1', '2', '3'], 4]) comment(#-----------------------------) comment(# @@PLEAC@@_11.13) keyword(import) ident(pickle) -keyword(class) ident(Foo)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Foo)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(val) operator(=) integer(1) ident(x) operator(=) ident(Foo)operator(()operator(\)) @@ -6805,13 +6805,13 @@ comment(# Use the heapq module instead?) keyword(import) ident(random) keyword(import) ident(warnings) -keyword(class) ident(BTree)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(BTree)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(value) operator(=) pre_constant(None) comment(### insert given value into proper point of) comment(### the tree, extending this node if necessary.) - keyword(def) ident(insert)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(insert)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) keyword(if) pre_constant(self)operator(.)ident(value) keyword(is) pre_constant(None)operator(:) pre_constant(self)operator(.)ident(left) operator(=) ident(BTree)operator(()operator(\)) pre_constant(self)operator(.)ident(right) operator(=) ident(BTree)operator(()operator(\)) @@ -6826,7 +6826,7 @@ keyword(class) ident(BTree)operator(()predefined(object)operator(\))operator(:) comment(# recurse on left child, ) comment(# then show current value, ) comment(# then recurse on right child.) - keyword(def) ident(in_order)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(in_order)operator(()pre_constant(self)operator(\))operator(:) keyword(if) pre_constant(self)operator(.)ident(value) keyword(is) keyword(not) pre_constant(None)operator(:) pre_constant(self)operator(.)ident(left)operator(.)ident(in_order)operator(()operator(\)) keyword(print) pre_constant(self)operator(.)ident(value)operator(,) @@ -6835,7 +6835,7 @@ keyword(class) ident(BTree)operator(()predefined(object)operator(\))operator(:) comment(# show current value, ) comment(# then recurse on left child, ) comment(# then recurse on right child.) - keyword(def) ident(pre_order)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(pre_order)operator(()pre_constant(self)operator(\))operator(:) keyword(if) pre_constant(self)operator(.)ident(value) keyword(is) keyword(not) pre_constant(None)operator(:) keyword(print) pre_constant(self)operator(.)ident(value)operator(,) pre_constant(self)operator(.)ident(left)operator(.)ident(pre_order)operator(()operator(\)) @@ -6844,7 +6844,7 @@ keyword(class) ident(BTree)operator(()predefined(object)operator(\))operator(:) comment(# recurse on left child, ) comment(# then recurse on right child,) comment(# then show current value. ) - keyword(def) ident(post_order)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(post_order)operator(()pre_constant(self)operator(\))operator(:) keyword(if) pre_constant(self)operator(.)ident(value) keyword(is) keyword(not) pre_constant(None)operator(:) pre_constant(self)operator(.)ident(left)operator(.)ident(post_order)operator(()operator(\)) pre_constant(self)operator(.)ident(right)operator(.)ident(post_order)operator(()operator(\)) @@ -6854,7 +6854,7 @@ keyword(class) ident(BTree)operator(()predefined(object)operator(\))operator(:) comment(# if so, return the node at which the value was found.) comment(# cut down search time by only looking in the correct) comment(# branch, based on current value.) - keyword(def) ident(search)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(search)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) keyword(if) pre_constant(self)operator(.)ident(value) keyword(is) keyword(not) pre_constant(None)operator(:) keyword(if) pre_constant(self)operator(.)ident(value) operator(==) ident(value)operator(:) keyword(return) pre_constant(self) @@ -6863,7 +6863,7 @@ keyword(class) ident(BTree)operator(()predefined(object)operator(\))operator(:) keyword(else)operator(:) keyword(return) pre_constant(self)operator(.)ident(right)operator(.)ident(search)operator(()ident(value)operator(\)) -keyword(def) ident(test)operator(()operator(\))operator(:) +keyword(def) method(test)operator(()operator(\))operator(:) ident(root) operator(=) ident(BTree)operator(()operator(\)) keyword(for) ident(i) keyword(in) predefined(range)operator(()integer(20)operator(\))operator(:) @@ -6921,7 +6921,7 @@ comment(#-----------------------------) comment(#=== In the file Cards/Poker.py) ident(__all__) operator(=) operator([)string<delimiter(")content(card_deck)delimiter(")>operator(,) string<delimiter(")content(shuffle)delimiter(")>operator(]) comment(# not usually needed) ident(card_deck) operator(=) operator([)operator(]) -keyword(def) ident(shuffle)operator(()operator(\))operator(:) +keyword(def) method(shuffle)operator(()operator(\))operator(:) keyword(pass) comment(#-----------------------------) @@ -7046,7 +7046,7 @@ ident(O_EXCL)operator(,) ident(O_CREAT)operator(,) ident(O_RDWR) operator(=) ide comment(#-----------------------------) ident(load_module)operator(()string<delimiter(')content(os)delimiter(')>operator(,) string<delimiter(")content(O_EXCL O_CREAT O_RDWR)delimiter(")>operator(.)ident(split)operator(()operator(\))operator(\)) -keyword(def) ident(load_module)operator(()ident(module_name)operator(,) ident(symbols)operator(\))operator(:) +keyword(def) method(load_module)operator(()ident(module_name)operator(,) ident(symbols)operator(\))operator(:) ident(module) operator(=) predefined(__import__)operator(()ident(module_name)operator(\)) keyword(for) ident(symbol) keyword(in) ident(symbols)operator(:) predefined(globals)operator(()operator(\))operator([)ident(symbol)operator(]) operator(=) predefined(getattr)operator(()ident(module)operator(,) ident(symbol)operator(\)) @@ -7063,14 +7063,14 @@ ident(__all__) operator(=) operator([)string<delimiter(")content(flip_boundary)d ident(Separatrix) operator(=) string<delimiter(')content( )delimiter(')> comment(# default to blank) -keyword(def) ident(flip_boundary)operator(()ident(sep) operator(=) pre_constant(None)operator(\))operator(:) +keyword(def) method(flip_boundary)operator(()ident(sep) operator(=) pre_constant(None)operator(\))operator(:) ident(prev_sep) operator(=) ident(Separatrix) keyword(if) ident(sep) keyword(is) keyword(not) pre_constant(None)operator(:) keyword(global) ident(Separatrix) ident(Separatrix) operator(=) ident(sep) keyword(return) ident(prev_sep) -keyword(def) ident(flip_words)operator(()ident(line)operator(\))operator(:) +keyword(def) method(flip_words)operator(()ident(line)operator(\))operator(:) ident(words) operator(=) ident(line)operator(.)ident(split)operator(()ident(Separatrix)operator(\)) ident(words)operator(.)ident(reverse)operator(()operator(\)) keyword(return) ident(Separatrix)operator(.)ident(join)operator(()ident(words)operator(\)) @@ -7084,12 +7084,12 @@ ident(that_pack) operator(=) ident(sys)operator(.)ident(_getframe)operator(()int comment(#-----------------------------) keyword(print) string<delimiter(")content(I am in package)delimiter(")>operator(,) ident(__name__) comment(#-----------------------------) -keyword(def) ident(nreadline)operator(()ident(count)operator(,) ident(myfile)operator(\))operator(:) +keyword(def) method(nreadline)operator(()ident(count)operator(,) ident(myfile)operator(\))operator(:) keyword(if) ident(count) operator(<=) integer(0)operator(:) keyword(raise) exception(ValueError)operator(()string<delimiter(")content(Count must be > 0)delimiter(")>operator(\)) keyword(return) operator([)ident(myfile)operator(.)ident(readline)operator(()operator(\)) keyword(for) ident(i) keyword(in) predefined(range)operator(()ident(count)operator(\))operator(]) -keyword(def) ident(main)operator(()operator(\))operator(:) +keyword(def) method(main)operator(()operator(\))operator(:) ident(myfile) operator(=) predefined(open)operator(()string<delimiter(")content(/etc/termcap)delimiter(")>operator(\)) ident(a)operator(,) ident(b)operator(,) ident(c) operator(=) ident(nreadline)operator(()integer(3)operator(,) ident(myfile)operator(\)) ident(myfile)operator(.)ident(close)operator(()operator(\)) @@ -7100,9 +7100,9 @@ keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)del comment(# DON'T DO THIS:) keyword(import) ident(sys) -keyword(def) ident(nreadline)operator(()ident(count)operator(,) ident(handle_name)operator(\))operator(:) +keyword(def) method(nreadline)operator(()ident(count)operator(,) ident(handle_name)operator(\))operator(:) keyword(assert) ident(count) operator(>) integer(0)operator(,) string<delimiter(")content(count must be > 0)delimiter(")> - predefined(locals) operator(=) ident(sys)operator(.)ident(_getframe)operator(()integer(1)operator(\))operator(.)ident(f_locals) + ident(locals) operator(=) ident(sys)operator(.)ident(_getframe)operator(()integer(1)operator(\))operator(.)ident(f_locals) keyword(if) keyword(not) predefined(locals)operator(.)ident(has_key)operator(()ident(handle_name)operator(\))operator(:) keyword(raise) exception(AssertionError)operator(()string<delimiter(")content(need open filehandle)delimiter(")>operator(\)) ident(infile) operator(=) predefined(locals)operator([)ident(handle_name)operator(]) @@ -7114,7 +7114,7 @@ keyword(def) ident(nreadline)operator(()ident(count)operator(,) ident(handle_nam keyword(break) keyword(return) ident(retlist) -keyword(def) ident(main)operator(()operator(\))operator(:) +keyword(def) method(main)operator(()operator(\))operator(:) ident(FH) operator(=) predefined(open)operator(()string<delimiter(")content(/etc/termcap)delimiter(")>operator(\)) ident(a)operator(,) ident(b)operator(,) ident(c) operator(=) ident(nreadline)operator(()integer(3)operator(,) string<delimiter(")content(FH)delimiter(")>operator(\)) @@ -7128,28 +7128,28 @@ comment(## There is no direct equivalent in Python to an END block) keyword(import) ident(time)operator(,) ident(os)operator(,) ident(sys) comment(# Tricks to ensure the needed functions exist during module cleanup) -keyword(def) ident(_getgmtime)operator(()ident(asctime)operator(=)ident(time)operator(.)ident(asctime)operator(,) ident(gmtime)operator(=)ident(time)operator(.)ident(gmtime)operator(,) +keyword(def) method(_getgmtime)operator(()ident(asctime)operator(=)ident(time)operator(.)ident(asctime)operator(,) ident(gmtime)operator(=)ident(time)operator(.)ident(gmtime)operator(,) ident(t)operator(=)ident(time)operator(.)ident(time)operator(\))operator(:) keyword(return) ident(asctime)operator(()ident(gmtime)operator(()ident(t)operator(()operator(\))operator(\))operator(\)) -keyword(class) ident(Logfile)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) predefined(file)operator(\))operator(:) +keyword(class) class(Logfile)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) predefined(file)operator(\))operator(:) pre_constant(self)operator(.)ident(file) operator(=) predefined(file) - keyword(def) ident(_logmsg)operator(()pre_constant(self)operator(,) ident(msg)operator(,) ident(argv0)operator(=)ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])operator(,) ident(pid)operator(=)ident(os)operator(.)ident(getpid)operator(()operator(\))operator(,) + keyword(def) method(_logmsg)operator(()pre_constant(self)operator(,) ident(msg)operator(,) ident(argv0)operator(=)ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])operator(,) ident(pid)operator(=)ident(os)operator(.)ident(getpid)operator(()operator(\))operator(,) ident(_getgmtime)operator(=)ident(_getgmtime)operator(\))operator(:) comment(# more tricks to keep all needed references) ident(now) operator(=) ident(_getgmtime)operator(()operator(\)) keyword(print)operator(>>)pre_constant(self)operator(.)ident(file)operator(,) ident(argv0)operator(,) ident(pid)operator(,) ident(now) operator(+) string<delimiter(")content(:)delimiter(")>operator(,) ident(msg) - keyword(def) ident(logmsg)operator(()pre_constant(self)operator(,) ident(msg)operator(\))operator(:) + keyword(def) method(logmsg)operator(()pre_constant(self)operator(,) ident(msg)operator(\))operator(:) pre_constant(self)operator(.)ident(_logmsg)operator(()pre_constant(self)operator(.)ident(file)operator(,) ident(msg)operator(\)) - keyword(def) ident(__del__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__del__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(_logmsg)operator(()string<delimiter(")content(shutdown)delimiter(")>operator(\)) pre_constant(self)operator(.)ident(file)operator(.)ident(close)operator(()operator(\)) - keyword(def) ident(__getattr__)operator(()pre_constant(self)operator(,) ident(attr)operator(\))operator(:) + keyword(def) method(__getattr__)operator(()pre_constant(self)operator(,) ident(attr)operator(\))operator(:) comment(# forward everything else to the file handle) keyword(return) predefined(getattr)operator(()pre_constant(self)operator(.)ident(file)operator(,) ident(attr)operator(\)) @@ -7195,7 +7195,7 @@ ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)ope comment(#-----------------------------) keyword(import) ident(FindBin) ident(Bin) operator(=) string<delimiter(")content(Name)delimiter(")> -predefined(bin) operator(=) predefined(getattr)operator(()ident(FindBin)operator(,) ident(Bin)operator(\)) +ident(bin) operator(=) predefined(getattr)operator(()ident(FindBin)operator(,) ident(Bin)operator(\)) ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)operator(,) predefined(bin) operator(+) string<delimiter(")content(/../lib)delimiter(")>operator(\)) comment(#-----------------------------) @@ -7226,22 +7226,22 @@ comment(## Any definition in a Python module overrides the builtin) comment(## for that module) comment(#=== In MyModule) -keyword(def) predefined(open)operator(()operator(\))operator(:) +keyword(def) method(open)operator(()operator(\))operator(:) keyword(pass) comment(# TBA) comment(#-----------------------------) keyword(from) ident(MyModule) keyword(import) predefined(open) -predefined(file) operator(=) predefined(open)operator(()operator(\)) +ident(file) operator(=) predefined(open)operator(()operator(\)) comment(#-----------------------------) comment(# ^^PLEAC^^_12.12) comment(#-----------------------------) -keyword(def) ident(even_only)operator(()ident(n)operator(\))operator(:) +keyword(def) method(even_only)operator(()ident(n)operator(\))operator(:) keyword(if) ident(n) operator(&) integer(1)operator(:) comment(# one way to test) keyword(raise) exception(AssertionError)operator(()string<delimiter(")content(%s is not even)delimiter(")> operator(%) operator(()ident(n)operator(,)operator(\))operator(\)) comment(#....) comment(#-----------------------------) -keyword(def) ident(even_only)operator(()ident(n)operator(\))operator(:) +keyword(def) method(even_only)operator(()ident(n)operator(\))operator(:) keyword(if) ident(n) operator(%) integer(2)operator(:) comment(# here's another) comment(# choice of exception depends on the problem) keyword(raise) exception(TypeError)operator(()string<delimiter(")content(%s is not even)delimiter(")> operator(%) operator(()ident(n)operator(,)operator(\))operator(\)) @@ -7249,7 +7249,7 @@ keyword(def) ident(even_only)operator(()ident(n)operator(\))operator(:) comment(#-----------------------------) keyword(import) ident(warnings) -keyword(def) ident(even_only)operator(()ident(n)operator(\))operator(:) +keyword(def) method(even_only)operator(()ident(n)operator(\))operator(:) keyword(if) ident(n) operator(&) integer(1)operator(:) comment(# test whether odd number) ident(warnings)operator(.)ident(warn)operator(()string<delimiter(")content(%s is not even, continuing)delimiter(")> operator(%) operator(()ident(n)operator(\))operator(\)) ident(n) operator(+=) integer(1) @@ -7267,8 +7267,8 @@ predefined(getattr)operator(()predefined(__import__)operator(()ident(packname)op comment(#-----------------------------) comment(# DON'T DO THIS [Use math.log(val, base\) instead]) keyword(import) ident(math) -keyword(def) ident(make_log)operator(()ident(n)operator(\))operator(:) - keyword(def) ident(logn)operator(()ident(val)operator(\))operator(:) +keyword(def) method(make_log)operator(()ident(n)operator(\))operator(:) + keyword(def) method(logn)operator(()ident(val)operator(\))operator(:) keyword(return) ident(math)operator(.)ident(log)operator(()ident(val)operator(,) ident(n)operator(\)) keyword(return) ident(logn) @@ -7335,21 +7335,21 @@ comment(# ) comment(# Docstrings are automagically assigned to an object's __doc__ property.) comment(#) comment(# In other words these three classes are identical:) -keyword(class) ident(Foo)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(Foo)operator(()predefined(object)operator(\))operator(:) string<delimiter(")content(A class demonstrating docstrings.)delimiter(")> -keyword(class) ident(Foo)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(Foo)operator(()predefined(object)operator(\))operator(:) ident(__doc__) operator(=) string<delimiter(")content(A class demonstrating docstrings.)delimiter(")> -keyword(class) ident(Foo)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(Foo)operator(()predefined(object)operator(\))operator(:) keyword(pass) ident(Foo)operator(.)ident(__doc__) operator(=) string<delimiter(")content(A class demonstrating docstrings.)delimiter(")> comment(# as are these two functions:) -keyword(def) ident(foo)operator(()operator(\))operator(:) +keyword(def) method(foo)operator(()operator(\))operator(:) string<delimiter(")content(A function demonstrating docstrings.)delimiter(")> -keyword(def) ident(foo)operator(()operator(\))operator(:) +keyword(def) method(foo)operator(()operator(\))operator(:) keyword(pass) ident(foo)operator(.)ident(__doc__) operator(=) string<delimiter(")content(A function demonstrating docstrings.)delimiter(")> @@ -7403,7 +7403,7 @@ comment(#% pmdesc) comment(#-----------------------------) keyword(import) ident(sys)operator(,) ident(pydoc) -keyword(def) ident(print_module_info)operator(()ident(path)operator(,) ident(modname)operator(,) ident(desc)operator(\))operator(:) +keyword(def) method(print_module_info)operator(()ident(path)operator(,) ident(modname)operator(,) ident(desc)operator(\))operator(:) comment(# Skip files starting with "test_") keyword(if) ident(modname)operator(.)ident(split)operator(()string<delimiter(")content(.)delimiter(")>operator(\))operator([)operator(-)integer(1)operator(])operator(.)ident(startswith)operator(()string<delimiter(")content(test_)delimiter(")>operator(\))operator(:) keyword(return) @@ -7433,7 +7433,7 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_13.0) comment(#-----------------------------) comment(# Inside a module named 'Data' / file named 'Data.py') -keyword(class) ident(Encoder)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(Encoder)operator(()predefined(object)operator(\))operator(:) keyword(pass) comment(#-----------------------------) ident(obj) operator(=) operator([)integer(3)operator(,) integer(5)operator(]) @@ -7451,20 +7451,20 @@ ident(encoded) operator(=) predefined(object)operator(.)ident(encode)operator(() comment(#-----------------------------) ident(encoded) operator(=) ident(Data)operator(.)ident(Encoder)operator(.)ident(encode)operator(()string<delimiter(")content(data)delimiter(")>operator(\)) comment(#-----------------------------) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) keyword(pass) comment(#-----------------------------) -predefined(object) operator(=) ident(Class)operator(()operator(\)) +ident(object) operator(=) ident(Class)operator(()operator(\)) comment(#-----------------------------) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(class_only_method)operator(()operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(class_only_method)operator(()operator(\))operator(:) keyword(pass) comment(# more code here) ident(class_only_method) operator(=) predefined(staticmethod)operator(()ident(class_only_method)operator(\)) comment(#-----------------------------) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(instance_only_method)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(instance_only_method)operator(()pre_constant(self)operator(\))operator(:) keyword(pass) comment(# more code here) comment(#-----------------------------) ident(lector) operator(=) ident(Human)operator(.)ident(Cannibal)operator(()operator(\)) @@ -7481,18 +7481,18 @@ keyword(print)operator(>>)ident(sys)operator(.)ident(stderr)operator(,) string<d comment(# ^^PLEAC^^_13.1) comment(#-----------------------------) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) keyword(pass) comment(#-----------------------------) keyword(import) ident(time) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(start) operator(=) ident(time)operator(.)ident(time)operator(()operator(\)) comment(# init data fields) pre_constant(self)operator(.)ident(age) operator(=) integer(0) comment(#-----------------------------) keyword(import) ident(time) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(kwargs)operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(kwargs)operator(\))operator(:) comment(# Sets self.start to the current time, and self.age to 0. If called) comment(# with arguments, interpret them as key+value pairs to) comment(# initialize the object with) @@ -7503,8 +7503,8 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_13.2) comment(#-----------------------------) keyword(import) ident(time) -keyword(class) ident(Class)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__del__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__del__)operator(()pre_constant(self)operator(\))operator(:) keyword(print) pre_constant(self)operator(,) string<delimiter(")content(dying at)delimiter(")>operator(,) ident(time)operator(.)ident(ctime)operator(()operator(\)) comment(#-----------------------------) comment(## Why is the perl code introducing a cycle? I guess it's an) @@ -7515,8 +7515,8 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_13.3) comment(#-----------------------------) comment(# It is standard practice to access attributes directly:) -keyword(class) ident(MyClass)operator(()predefined(object)operator(\)) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(MyClass)operator(()predefined(object)operator(\)) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) string<delimiter(")content(default)delimiter(")> pre_constant(self)operator(.)ident(age) operator(=) integer(0) ident(obj) operator(=) ident(MyClass)operator(()operator(\)) @@ -7526,20 +7526,20 @@ ident(obj)operator(.)ident(age) operator(+=) integer(1) comment(# If you later find that you need to compute an attribute, you can always ) comment(# retrofit a property(\), leaving user code untouched:) -keyword(class) ident(MyClass)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(MyClass)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(_name) operator(=) string<delimiter(")content(default)delimiter(")> pre_constant(self)operator(.)ident(_age) operator(=) integer(0) - keyword(def) ident(get_name)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(get_name)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_name) - keyword(def) ident(set_name)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) + keyword(def) method(set_name)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) pre_constant(self)operator(.)ident(_name) operator(=) ident(name)operator(.)ident(title)operator(()operator(\)) ident(name) operator(=) predefined(property)operator(()ident(get_name)operator(,) ident(set_name)operator(\)) - keyword(def) ident(get_age)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(get_age)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_age) - keyword(def) ident(set_age)operator(()pre_constant(self)operator(,) ident(val)operator(\))operator(:) + keyword(def) method(set_age)operator(()pre_constant(self)operator(,) ident(val)operator(\))operator(:) keyword(if) ident(val) operator(<) integer(0)operator(:) keyword(raise) exception(ValueError)operator(()string<delimiter(")content(Invalid age: %s)delimiter(")> operator(%) ident(val)operator(\)) pre_constant(self)operator(.)ident(_age) operator(=) ident(val) @@ -7550,29 +7550,29 @@ keyword(print) ident(obj)operator(.)ident(name) ident(obj)operator(.)ident(age) operator(+=) integer(1) comment(# DON'T DO THIS - explicit getters and setters should not be used:) -keyword(class) ident(MyClass)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(MyClass)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) string<delimiter(")content(default)delimiter(")> - keyword(def) ident(get_name)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(get_name)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(name) - keyword(def) ident(set_name)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) + keyword(def) method(set_name)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) ident(name)operator(.)ident(title)operator(()operator(\)) ident(obj) operator(=) ident(MyClass)operator(()operator(\)) ident(obj)operator(.)ident(set_name)operator(()string<delimiter(")content(bob)delimiter(")>operator(\)) keyword(print) ident(obj)operator(.)ident(get_name)operator(()operator(\)) comment(#-----------------------------) comment(## DON'T DO THIS (It's complex, ugly, and unnecessary\):) -keyword(class) ident(MyClass)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(MyClass)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(age) operator(=) integer(0) - keyword(def) ident(name)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) + keyword(def) method(name)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) keyword(if) predefined(len)operator(()ident(args)operator(\)) operator(==) integer(0)operator(:) keyword(return) pre_constant(self)operator(.)ident(name) keyword(elif) predefined(len)operator(()ident(args)operator(\)) operator(==) integer(1)operator(:) pre_constant(self)operator(.)ident(name) operator(=) ident(args)operator([)integer(0)operator(]) keyword(else)operator(:) keyword(raise) exception(TypeError)operator(()string<delimiter(")content(name only takes 0 or 1 arguments)delimiter(")>operator(\)) - keyword(def) ident(age)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) + keyword(def) method(age)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) ident(prev) operator(=) pre_constant(self)operator(.)ident(age) keyword(if) ident(args)operator(:) pre_constant(self)operator(.)ident(age) operator(=) ident(args)operator([)integer(0)operator(]) @@ -7593,19 +7593,19 @@ comment(# more common way to do parameter checking of attribute assignment.) keyword(import) ident(re)operator(,) ident(sys) -keyword(def) ident(carp)operator(()ident(s)operator(\))operator(:) +keyword(def) method(carp)operator(()ident(s)operator(\))operator(:) ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()string<delimiter(")content(WARNING: )delimiter(")> operator(+) ident(s) operator(+) string<delimiter(")char(\\n)delimiter(")>operator(\)) -keyword(class) ident(Class)operator(:) +keyword(class) class(Class)operator(:) ident(no_name) operator(=) operator([)operator(]) - keyword(def) ident(name)operator(()pre_constant(self)operator(,) ident(value) operator(=) ident(no_name)operator(\))operator(:) + keyword(def) method(name)operator(()pre_constant(self)operator(,) ident(value) operator(=) ident(no_name)operator(\))operator(:) keyword(if) ident(value) keyword(is) ident(Class)operator(.)ident(no_name)operator(:) keyword(return) pre_constant(self)operator(.)ident(NAME) ident(value) operator(=) pre_constant(self)operator(.)ident(_enforce_name_value)operator(()ident(value)operator(\)) pre_constant(self)operator(.)ident(NAME) operator(=) ident(value) - keyword(def) ident(_enforce_name_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(_enforce_name_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) keyword(if) ident(re)operator(.)ident(search)operator(()string<modifier(r)delimiter(")content([^)content(\\s)content(\\w)content('-])delimiter(")>operator(,) ident(value)operator(\))operator(:) ident(carp)operator(()string<delimiter(")content(funny characters in name)delimiter(")>operator(\)) keyword(if) ident(re)operator(.)ident(search)operator(()string<modifier(r)delimiter(")content(\\d)delimiter(")>operator(,) ident(value)operator(\))operator(:) @@ -7618,13 +7618,13 @@ keyword(class) ident(Class)operator(:) comment(#-----------------------------) comment(# A more typical way to enforce restrictions on a value) comment(# to set) -keyword(class) ident(Class)operator(:) - keyword(def) ident(__setattr__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(value)operator(\))operator(:) +keyword(class) class(Class)operator(:) + keyword(def) method(__setattr__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(value)operator(\))operator(:) keyword(if) ident(name) operator(==) string<delimiter(")content(name)delimiter(")>operator(:) ident(value) operator(=) pre_constant(self)operator(.)ident(_enforce_name_value)operator(()ident(value)operator(\)) comment(# Do any conversions) pre_constant(self)operator(.)ident(__dict__)operator([)ident(name)operator(]) operator(=) ident(value) comment(# Do the default __setattr__ action) - keyword(def) ident(_enforce_name_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(_enforce_name_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) keyword(if) ident(re)operator(.)ident(search)operator(()string<modifier(r)delimiter(")content([^)content(\\s)content(\\w)content('-])delimiter(")>operator(,) ident(value)operator(\))operator(:) ident(carp)operator(()string<delimiter(")content(funny characters in name)delimiter(")>operator(\)) keyword(if) ident(re)operator(.)ident(search)operator(()string<modifier(r)delimiter(")content(\\d)delimiter(")>operator(,) ident(value)operator(\))operator(:) @@ -7636,18 +7636,18 @@ keyword(class) ident(Class)operator(:) keyword(return) ident(value)operator(.)ident(upper)operator(()operator(\)) comment(# enforce capitalization) comment(#-----------------------------) -keyword(class) ident(Person)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(name) operator(=) pre_constant(None)operator(,) ident(age) operator(=) pre_constant(None)operator(,) ident(peers) operator(=) pre_constant(None)operator(\))operator(:) +keyword(class) class(Person)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(name) operator(=) pre_constant(None)operator(,) ident(age) operator(=) pre_constant(None)operator(,) ident(peers) operator(=) pre_constant(None)operator(\))operator(:) keyword(if) ident(peers) keyword(is) pre_constant(None)operator(:) ident(peers) operator(=) operator([)operator(]) comment(# See Python FAQ 6.25) pre_constant(self)operator(.)ident(name) operator(=) ident(name) pre_constant(self)operator(.)ident(age) operator(=) ident(age) pre_constant(self)operator(.)ident(peers) operator(=) ident(peers) - keyword(def) ident(exclaim)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(exclaim)operator(()pre_constant(self)operator(\))operator(:) keyword(return) string<delimiter(")content(Hi, I'm %s, age %d, working with %s)delimiter(")> operator(%) \ operator(()pre_constant(self)operator(.)ident(name)operator(,) pre_constant(self)operator(.)ident(age)operator(,) string<delimiter(")content(, )delimiter(")>operator(.)ident(join)operator(()pre_constant(self)operator(.)ident(peers)operator(\))operator(\)) - keyword(def) ident(happy_birthday)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(happy_birthday)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(age) operator(+=) integer(1) keyword(return) pre_constant(self)operator(.)ident(age) comment(#-----------------------------) @@ -7655,16 +7655,16 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_13.4) comment(#-----------------------------) comment(## In the module named 'Person' ...) -keyword(def) ident(population)operator(()operator(\))operator(:) +keyword(def) method(population)operator(()operator(\))operator(:) keyword(return) ident(Person)operator(.)ident(body_count)operator([)integer(0)operator(]) -keyword(class) ident(Person)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(Person)operator(()predefined(object)operator(\))operator(:) ident(body_count) operator(=) operator([)integer(0)operator(]) comment(# class variable - shared across all instances) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(body_count)operator([)integer(0)operator(]) operator(+=) integer(1) - keyword(def) ident(__del__)operator(()pre_constant(self)operator(\))operator(:) comment(# Beware - may be non-deterministic (Jython\)!) + keyword(def) method(__del__)operator(()pre_constant(self)operator(\))operator(:) comment(# Beware - may be non-deterministic (Jython\)!) pre_constant(self)operator(.)ident(body_count)operator([)integer(0)operator(]) operator(-=) integer(1) comment(# later, the user can say this:) @@ -7695,16 +7695,16 @@ comment(#=>50) comment(#-----------------------------) comment(# In the module named 'FixedArray') -keyword(class) ident(FixedArray)operator(()predefined(object)operator(\))operator(:) +keyword(class) class(FixedArray)operator(()predefined(object)operator(\))operator(:) ident(_max_bounds) operator(=) operator([)integer(7)operator(]) comment(# Shared across whole class) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(bounds)operator(=)pre_constant(None)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(bounds)operator(=)pre_constant(None)operator(\))operator(:) keyword(if) ident(bounds) keyword(is) keyword(not) pre_constant(None)operator(:) pre_constant(self)operator(.)ident(max_bounds) operator(=) ident(bounds) - keyword(def) ident(get_max_bounds)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(get_max_bounds)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_max_bounds)operator([)integer(0)operator(]) - keyword(def) ident(set_max_bounds)operator(()pre_constant(self)operator(,) ident(val)operator(\))operator(:) + keyword(def) method(set_max_bounds)operator(()pre_constant(self)operator(,) ident(val)operator(\))operator(:) pre_constant(self)operator(.)ident(_max_bounds)operator([)integer(0)operator(]) operator(=) ident(val) ident(max_bounds) operator(=) predefined(property)operator(()ident(get_max_bounds)operator(,) ident(set_max_bounds)operator(\)) comment(#-----------------------------) @@ -7713,8 +7713,8 @@ comment(# ^^PLEAC^^_13.5) comment(#-----------------------------) comment(# There isn't the severe separation between scalar, arrays and hashs) comment(# in Python, so there isn't a direct equivalent to the Perl code.) -keyword(class) ident(Person)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(name)operator(=)pre_constant(None)operator(,) ident(age)operator(=)pre_constant(None)operator(,) ident(peers)operator(=)pre_constant(None)operator(\))operator(:) +keyword(class) class(Person)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(name)operator(=)pre_constant(None)operator(,) ident(age)operator(=)pre_constant(None)operator(,) ident(peers)operator(=)pre_constant(None)operator(\))operator(:) keyword(if) ident(peers) keyword(is) pre_constant(None)operator(:) ident(peers) operator(=) operator([)operator(]) pre_constant(self)operator(.)ident(name) operator(=) ident(name) @@ -7742,14 +7742,14 @@ comment(#-----------------------------) comment(# This isn't very Pythonic - should create objects with the) comment(# needed data, and not depend on defaults and modifing the object.) keyword(import) ident(sys) -keyword(def) ident(carp)operator(()ident(s)operator(\))operator(:) +keyword(def) method(carp)operator(()ident(s)operator(\))operator(:) ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()string<delimiter(")content(WARNING: )delimiter(")> operator(+) ident(s) operator(+) string<delimiter(")char(\\n)delimiter(")>operator(\)) -keyword(class) ident(Person)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(name) operator(=) string<delimiter(")delimiter(")>operator(,) ident(age) operator(=) integer(0)operator(\))operator(:) +keyword(class) class(Person)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(name) operator(=) string<delimiter(")delimiter(")>operator(,) ident(age) operator(=) integer(0)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) ident(name) pre_constant(self)operator(.)ident(age) operator(=) ident(age) - keyword(def) ident(__setattr__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(__setattr__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(value)operator(\))operator(:) keyword(if) ident(name) operator(==) string<delimiter(")content(age)delimiter(")>operator(:) comment(# This is very unpythonic) keyword(if) keyword(not) predefined(isinstance)operator(()ident(value)operator(,) predefined(type)operator(()integer(0)operator(\))operator(\))operator(:) @@ -7757,8 +7757,8 @@ keyword(class) ident(Person)operator(:) keyword(if) ident(value) operator(>) integer(150)operator(:) ident(carp)operator(()string<delimiter(")content(age '%s' is unreasonable)delimiter(")> operator(%) operator(()ident(value)operator(,)operator(\))operator(\)) pre_constant(self)operator(.)ident(__dict__)operator([)ident(name)operator(]) operator(=) ident(value) -keyword(class) ident(Family)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(head) operator(=) pre_constant(None)operator(,) ident(address) operator(=) string<delimiter(")delimiter(")>operator(,) ident(members) operator(=) pre_constant(None)operator(\))operator(:) +keyword(class) class(Family)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(head) operator(=) pre_constant(None)operator(,) ident(address) operator(=) string<delimiter(")delimiter(")>operator(,) ident(members) operator(=) pre_constant(None)operator(\))operator(:) keyword(if) ident(members) keyword(is) pre_constant(None)operator(:) ident(members) operator(=) operator([)operator(]) pre_constant(self)operator(.)ident(head) operator(=) ident(head) keyword(or) ident(Person)operator(()operator(\)) pre_constant(self)operator(.)ident(address) operator(=) ident(address) @@ -7772,9 +7772,9 @@ ident(dad)operator(.)ident(age) operator(=) integer(34) keyword(print) string<delimiter(")content(%s's age is %d)delimiter(")> operator(%) operator(()ident(folks)operator(.)ident(head)operator(.)ident(name)operator(,) ident(folks)operator(.)ident(head)operator(.)ident(age)operator(\)) comment(#-----------------------------) -keyword(class) ident(Card)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(name)operator(=)pre_constant(None)operator(,) ident(color)operator(=)pre_constant(None)operator(,) ident(cost)operator(=)pre_constant(None)operator(,) - predefined(type)operator(=)pre_constant(None)operator(,) ident(release)operator(=)pre_constant(None)operator(,) ident(text)operator(=)pre_constant(None)operator(\))operator(:) +keyword(class) class(Card)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(name)operator(=)pre_constant(None)operator(,) ident(color)operator(=)pre_constant(None)operator(,) ident(cost)operator(=)pre_constant(None)operator(,) + ident(type)operator(=)pre_constant(None)operator(,) ident(release)operator(=)pre_constant(None)operator(,) ident(text)operator(=)pre_constant(None)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) ident(name) pre_constant(self)operator(.)ident(color) operator(=) ident(color) pre_constant(self)operator(.)ident(cost) operator(=) ident(cost) @@ -7783,25 +7783,25 @@ keyword(class) ident(Card)operator(:) pre_constant(self)operator(.)ident(type) operator(=) predefined(type) comment(#-----------------------------) comment(# For positional args) -keyword(class) ident(Card)operator(:) +keyword(class) class(Card)operator(:) ident(_names) operator(=) operator(()string<delimiter(")content(name)delimiter(")>operator(,) string<delimiter(")content(color)delimiter(")>operator(,) string<delimiter(")content(cost)delimiter(")>operator(,) string<delimiter(")content(type)delimiter(")>operator(,) string<delimiter(")content(release)delimiter(")>operator(,) string<delimiter(")content(type)delimiter(")>operator(\)) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) keyword(assert) predefined(len)operator(()ident(args)operator(\)) operator(<=) predefined(len)operator(()pre_constant(self)operator(.)ident(_names)operator(\)) keyword(for) ident(k)operator(,) ident(v) keyword(in) predefined(zip)operator(()pre_constant(self)operator(.)ident(_names)operator(,) ident(args)operator(\))operator(:) predefined(setattr)operator(()pre_constant(self)operator(,) ident(k)operator(,) pre_constant(None)operator(\)) comment(#-----------------------------) comment(# For keyword args) -keyword(class) ident(Card)operator(:) +keyword(class) class(Card)operator(:) ident(_names) operator(=) operator(()string<delimiter(")content(name)delimiter(")>operator(,) string<delimiter(")content(color)delimiter(")>operator(,) string<delimiter(")content(cost)delimiter(")>operator(,) string<delimiter(")content(type)delimiter(")>operator(,) string<delimiter(")content(release)delimiter(")>operator(,) string<delimiter(")content(type)delimiter(")>operator(\)) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(kwargs)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(kwargs)operator(\))operator(:) keyword(for) ident(k) keyword(in) pre_constant(self)operator(.)ident(_names)operator(:) comment(# Set the defaults) predefined(setattr)operator(()pre_constant(self)operator(,) ident(k)operator(,) pre_constant(None)operator(\)) keyword(for) ident(k)operator(,) ident(v) keyword(in) ident(kwargs)operator(.)ident(items)operator(()operator(\))operator(:) comment(# add in the kwargs) keyword(assert) ident(k) keyword(in) pre_constant(self)operator(.)ident(_names)operator(,) string<delimiter(")content(Unexpected kwarg: )delimiter(")> operator(+) ident(k) predefined(setattr)operator(()pre_constant(self)operator(,) ident(k)operator(,) ident(v)operator(\)) comment(#-----------------------------) -keyword(class) ident(hostent)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(addr_list) operator(=) pre_constant(None)operator(,) ident(length) operator(=) pre_constant(None)operator(,) +keyword(class) class(hostent)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(addr_list) operator(=) pre_constant(None)operator(,) ident(length) operator(=) pre_constant(None)operator(,) ident(addrtype) operator(=) pre_constant(None)operator(,) ident(aliases) operator(=) pre_constant(None)operator(,) ident(name) operator(=) pre_constant(None)operator(\))operator(:) pre_constant(self)operator(.)ident(addr_list) operator(=) ident(addr_list) keyword(or) operator([)operator(]) pre_constant(self)operator(.)ident(length) operator(=) ident(length) keyword(or) integer(0) @@ -7832,7 +7832,7 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_13.6) comment(#-----------------------------) -keyword(class) ident(Class)operator(()ident(Parent)operator(\))operator(:) +keyword(class) class(Class)operator(()ident(Parent)operator(\))operator(:) keyword(pass) comment(#-----------------------------) comment(## Note: this is unusual in Python code) @@ -7847,8 +7847,8 @@ comment(#-----------------------------) comment(# XXX I do not know the intent of the original Perl code) comment(# Do not use this style of programming in Python.) keyword(import) ident(time) -keyword(class) ident(Person)operator(()ident(possible)operator(,)ident(base)operator(,)ident(classes)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) +keyword(class) class(Person)operator(()ident(possible)operator(,)ident(base)operator(,)ident(classes)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) comment(# Call the parents' constructors, if there are any) keyword(for) ident(baseclass) keyword(in) pre_constant(self)operator(.)ident(__class__)operator(.)ident(__bases__)operator(:) ident(init) operator(=) predefined(getattr)operator(()ident(baseclass)operator(,) string<delimiter(")content(__init__)delimiter(")>operator(\)) @@ -7928,8 +7928,8 @@ comment(# Note: This uses the standard Python idiom of accessing the) comment(# attributes directly rather than going through a method call.) comment(# See earlier in this chapter for examples of how this does) comment(# not break encapsulation.) -keyword(class) ident(Person)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(name) operator(=) string<delimiter(")delimiter(")>operator(,) ident(age) operator(=) integer(0)operator(\))operator(:) +keyword(class) class(Person)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(name) operator(=) string<delimiter(")delimiter(")>operator(,) ident(age) operator(=) integer(0)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) ident(name) pre_constant(self)operator(.)ident(age) operator(=) ident(age) comment(#-----------------------------) @@ -7939,7 +7939,7 @@ ident(dude)operator(.)ident(name) operator(=) string<delimiter(")content(Jason)d ident(dude)operator(.)ident(age) operator(=) integer(23) keyword(print) string<delimiter(")content(%s is age %d.)delimiter(")> operator(%) operator(()ident(dude)operator(.)ident(name)operator(,) ident(dude)operator(.)ident(age)operator(\)) comment(#-----------------------------) -keyword(class) ident(Employee)operator(()ident(Person)operator(\))operator(:) +keyword(class) class(Employee)operator(()ident(Person)operator(\))operator(:) keyword(pass) comment(#-----------------------------) comment(# Prefered: empl = Employee("Jason", 23\)) @@ -7953,20 +7953,20 @@ comment(# ^^PLEAC^^_13.10) comment(#-----------------------------) comment(# This doesn't need to be done since if 'method' doesn't) comment(# exist in the Class it will be looked for in its BaseClass(es\)) -keyword(class) ident(Class)operator(()ident(BaseClass)operator(\))operator(:) - keyword(def) ident(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) +keyword(class) class(Class)operator(()ident(BaseClass)operator(\))operator(:) + keyword(def) method(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) ident(BaseClass)operator(.)ident(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\)) comment(# This lets you pick the specific method in one of the base classes) -keyword(class) ident(Class)operator(()ident(BaseClass1)operator(,) ident(BaseClass2)operator(\))operator(:) - keyword(def) ident(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) +keyword(class) class(Class)operator(()ident(BaseClass1)operator(,) ident(BaseClass2)operator(\))operator(:) + keyword(def) method(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) ident(BaseClass2)operator(.)ident(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\)) comment(# This looks for the first method in the base class(es\) without) comment(# specifically knowing which base class. This reimplements) comment(# the default action so isn't really needed.) -keyword(class) ident(Class)operator(()ident(BaseClass1)operator(,) ident(BaseClass2)operator(,) ident(BaseClass3)operator(\))operator(:) - keyword(def) ident(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) +keyword(class) class(Class)operator(()ident(BaseClass1)operator(,) ident(BaseClass2)operator(,) ident(BaseClass3)operator(\))operator(:) + keyword(def) method(method)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) keyword(for) ident(baseclass) keyword(in) pre_constant(self)operator(.)ident(__class__)operator(.)ident(__bases__)operator(:) ident(f) operator(=) predefined(getattr)operator(()ident(baseclass)operator(,) string<delimiter(")content(method)delimiter(")>operator(\)) keyword(if) ident(f) keyword(is) keyword(not) pre_constant(None)operator(:) @@ -7987,8 +7987,8 @@ keyword(import) ident(time) comment(# The Perl code calls a private '_init' function, but in) comment(# Python there's need for the complexity of 'new' mechanism) comment(# so it's best just to put the '_init' code in '__init__'.) -keyword(class) ident(Class)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) +keyword(class) class(Class)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(\))operator(:) comment(# init data fields) pre_constant(self)operator(.)ident(START) operator(=) ident(time)operator(.)ident(time)operator(()operator(\)) pre_constant(self)operator(.)ident(AGE) operator(=) integer(0) @@ -7996,8 +7996,8 @@ keyword(class) ident(Class)operator(:) comment(#-----------------------------) ident(obj) operator(=) ident(Widget)operator(()ident(haircolor) operator(=) string<delimiter(")content(red)delimiter(")>operator(,) ident(freckles) operator(=) integer(121)operator(\)) comment(#-----------------------------) -keyword(class) ident(Class)operator(()ident(Base1)operator(,) ident(Base2)operator(,) ident(Base3)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) +keyword(class) class(Class)operator(()ident(Base1)operator(,) ident(Base2)operator(,) ident(Base3)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:) keyword(for) ident(base) keyword(in) pre_constant(self)operator(.)ident(__class__)operator(.)ident(__bases__)operator(:) ident(f) operator(=) predefined(getattr)operator(()ident(base)operator(,) string<delimiter(")content(__init__)delimiter(")>operator(\)) keyword(if) ident(f) keyword(is) keyword(not) pre_constant(None)operator(:) @@ -8012,15 +8012,15 @@ comment(# *may* be equivalent, but I don't know enough about it. So) comment(# instead I'll describe a class that lets you restrict access) comment(# to only specific attributes.) -keyword(class) ident(Private)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(names)operator(\))operator(:) +keyword(class) class(Private)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(names)operator(\))operator(:) pre_constant(self)operator(.)ident(__names) operator(=) ident(names) pre_constant(self)operator(.)ident(__data) operator(=) operator({)operator(}) - keyword(def) ident(__getattr__)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) + keyword(def) method(__getattr__)operator(()pre_constant(self)operator(,) ident(name)operator(\))operator(:) keyword(if) ident(name) keyword(in) pre_constant(self)operator(.)ident(__names)operator(:) keyword(return) pre_constant(self)operator(.)ident(__data)operator([)ident(name)operator(]) keyword(raise) exception(AttributeError)operator(()ident(name)operator(\)) - keyword(def) ident(__setattr__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(__setattr__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(value)operator(\))operator(:) keyword(if) ident(name)operator(.)ident(startswith)operator(()string<delimiter(")content(_Private)delimiter(")>operator(\))operator(:) pre_constant(self)operator(.)ident(__dict__)operator([)ident(name)operator(]) operator(=) ident(value) keyword(return) @@ -8029,11 +8029,11 @@ keyword(class) ident(Private)operator(:) keyword(return) keyword(raise) exception(TypeError)operator(()string<delimiter(")content(cannot set the attribute %r)delimiter(")> operator(%) operator(()ident(name)operator(,)operator(\))operator(\)) -keyword(class) ident(Person)operator(()ident(Private)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(parent) operator(=) pre_constant(None)operator(\))operator(:) +keyword(class) class(Person)operator(()ident(Private)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(parent) operator(=) pre_constant(None)operator(\))operator(:) ident(Private)operator(.)ident(__init__)operator(()pre_constant(self)operator(,) operator([)string<delimiter(")content(name)delimiter(")>operator(,) string<delimiter(")content(age)delimiter(")>operator(,) string<delimiter(")content(peers)delimiter(")>operator(,) string<delimiter(")content(parent)delimiter(")>operator(])operator(\)) pre_constant(self)operator(.)ident(parent) operator(=) ident(parent) - keyword(def) ident(new_child)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(new_child)operator(()pre_constant(self)operator(\))operator(:) keyword(return) ident(Person)operator(()pre_constant(self)operator(\)) comment(#-----------------------------) ident(dad) operator(=) ident(Person)operator(()operator(\)) @@ -8059,18 +8059,18 @@ comment(# show how to have the container's __del__ remove cycles in) comment(# its contents. Note that Python 2.0 includes a garbage) comment(# collector that is able to remove these sorts of cycles, but) comment(# it's still best to prevent cycles in your code.) -keyword(class) ident(Node)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(value) operator(=) pre_constant(None)operator(\))operator(:) +keyword(class) class(Node)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(value) operator(=) pre_constant(None)operator(\))operator(:) pre_constant(self)operator(.)ident(next) operator(=) pre_constant(self) pre_constant(self)operator(.)ident(prev) operator(=) pre_constant(self) pre_constant(self)operator(.)ident(value) operator(=) ident(value) -keyword(class) ident(Ring)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Ring)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(ring) operator(=) pre_constant(None) pre_constant(self)operator(.)ident(count) operator(=) integer(0) - keyword(def) ident(__str__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__str__)operator(()pre_constant(self)operator(\))operator(:) comment(# Helpful when debugging, to print the contents of the ring) ident(s) operator(=) string<delimiter(")content(#%d: )delimiter(")> operator(%) pre_constant(self)operator(.)ident(count) ident(x) operator(=) pre_constant(self)operator(.)ident(ring) @@ -8084,7 +8084,7 @@ keyword(class) ident(Ring)operator(:) keyword(break) keyword(return) ident(s) operator(+) string<delimiter(")content( -> )delimiter(")>operator(.)ident(join)operator(()predefined(map)operator(()predefined(str)operator(,) ident(values)operator(\))operator(\)) operator(+) string<delimiter(")content( ->)delimiter(")> - keyword(def) ident(search)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(search)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) ident(node) operator(=) pre_constant(self)operator(.)ident(ring) keyword(while) pre_constant(True)operator(:) keyword(if) ident(node)operator(.)ident(value) operator(==) ident(value)operator(:) @@ -8093,7 +8093,7 @@ keyword(class) ident(Ring)operator(:) keyword(if) ident(node) keyword(is) pre_constant(self)operator(.)ident(ring)operator(:) keyword(break) - keyword(def) ident(insert_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(insert_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) ident(node) operator(=) ident(Node)operator(()ident(value)operator(\)) keyword(if) pre_constant(self)operator(.)ident(ring) keyword(is) keyword(not) pre_constant(None)operator(:) ident(node)operator(.)ident(prev)operator(,) ident(node)operator(.)ident(next) operator(=) pre_constant(self)operator(.)ident(ring)operator(.)ident(prev)operator(,) pre_constant(self)operator(.)ident(ring) @@ -8101,12 +8101,12 @@ keyword(class) ident(Ring)operator(:) pre_constant(self)operator(.)ident(ring) operator(=) ident(node) pre_constant(self)operator(.)ident(count) operator(+=) integer(1) - keyword(def) ident(delete_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) + keyword(def) method(delete_value)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) ident(node) operator(=) pre_constant(self)operator(.)ident(search)operator(()ident(value)operator(\)) keyword(if) ident(node) keyword(is) keyword(not) pre_constant(None)operator(:) pre_constant(self)operator(.)ident(delete_node)operator(()ident(node)operator(\)) - keyword(def) ident(delete_node)operator(()pre_constant(self)operator(,) ident(node)operator(\))operator(:) + keyword(def) method(delete_node)operator(()pre_constant(self)operator(,) ident(node)operator(\))operator(:) keyword(if) ident(node) keyword(is) ident(node)operator(.)ident(next)operator(:) ident(node)operator(.)ident(next) operator(=) ident(node)operator(.)ident(prev) operator(=) pre_constant(None) pre_constant(self)operator(.)ident(ring) operator(=) pre_constant(None) @@ -8116,7 +8116,7 @@ keyword(class) ident(Ring)operator(:) pre_constant(self)operator(.)ident(ring) operator(=) ident(node)operator(.)ident(next) pre_constant(self)operator(.)ident(count) operator(-=) integer(1) - keyword(def) ident(__del__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__del__)operator(()pre_constant(self)operator(\))operator(:) keyword(while) pre_constant(self)operator(.)ident(ring) keyword(is) keyword(not) pre_constant(None)operator(:) pre_constant(self)operator(.)ident(delete_node)operator(()pre_constant(self)operator(.)ident(ring)operator(\)) @@ -8130,27 +8130,27 @@ comment(#-----------------------------) comment(# ^^PLEAC^^_13.14) comment(#-----------------------------) keyword(import) ident(UserString) -keyword(class) ident(MyString)operator(()ident(UserString)operator(.)ident(UserString)operator(\))operator(:) - keyword(def) ident(__cmp__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) +keyword(class) class(MyString)operator(()ident(UserString)operator(.)ident(UserString)operator(\))operator(:) + keyword(def) method(__cmp__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) keyword(return) predefined(cmp)operator(()pre_constant(self)operator(.)ident(data)operator(.)ident(upper)operator(()operator(\))operator(,) ident(other)operator(.)ident(upper)operator(()operator(\))operator(\)) -keyword(class) ident(Person)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(idnum)operator(\))operator(:) +keyword(class) class(Person)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(name)operator(,) ident(idnum)operator(\))operator(:) pre_constant(self)operator(.)ident(name) operator(=) ident(name) pre_constant(self)operator(.)ident(idnum) operator(=) ident(idnum) - keyword(def) ident(__str__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__str__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) string<delimiter(")content(%s (%05d\))delimiter(")> operator(%) operator(()pre_constant(self)operator(.)ident(name)operator(.)ident(lower)operator(()operator(\))operator(.)ident(capitalize)operator(()operator(\))operator(,) pre_constant(self)operator(.)ident(idnum)operator(\)) comment(#-----------------------------) -keyword(class) ident(TimeNumber)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\))operator(:) +keyword(class) class(TimeNumber)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\))operator(:) keyword(assert) ident(minutes) operator(<) integer(60) keyword(and) ident(seconds) operator(<) integer(60) pre_constant(self)operator(.)ident(hours) operator(=) ident(hours) pre_constant(self)operator(.)ident(minutes) operator(=) ident(minutes) pre_constant(self)operator(.)ident(seconds) operator(=) ident(seconds) - keyword(def) ident(__str__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__str__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) string<delimiter(")content(%d:%02d:%02d)delimiter(")> operator(%) operator(()pre_constant(self)operator(.)ident(hours)operator(,) pre_constant(self)operator(.)ident(minutes)operator(,) pre_constant(self)operator(.)ident(seconds)operator(\)) - keyword(def) ident(__add__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__add__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) ident(seconds) operator(=) pre_constant(self)operator(.)ident(seconds) operator(+) ident(other)operator(.)ident(seconds) ident(minutes) operator(=) pre_constant(self)operator(.)ident(minutes) operator(+) ident(other)operator(.)ident(minutes) ident(hours) operator(=) pre_constant(self)operator(.)ident(hours) operator(+) ident(other)operator(.)ident(hours) @@ -8162,56 +8162,56 @@ keyword(class) ident(TimeNumber)operator(:) ident(hours) operator(+=) integer(1) keyword(return) ident(TimeNumber)operator(()ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) - keyword(def) ident(__sub__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__sub__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) keyword(raise) exception(NotImplementedError) - keyword(def) ident(__mul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__mul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) keyword(raise) exception(NotImplementedError) - keyword(def) ident(__div__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__div__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) keyword(raise) exception(NotImplementedError) ident(t1) operator(=) ident(TimeNumber)operator(()integer(0)operator(,) integer(58)operator(,) integer(59)operator(\)) ident(sec) operator(=) ident(TimeNumber)operator(()integer(0)operator(,) integer(0)operator(,) integer(1)operator(\)) -predefined(min) operator(=) ident(TimeNumber)operator(()integer(0)operator(,) integer(1)operator(,) integer(0)operator(\)) +ident(min) operator(=) ident(TimeNumber)operator(()integer(0)operator(,) integer(1)operator(,) integer(0)operator(\)) keyword(print) ident(t1) operator(+) ident(sec) operator(+) predefined(min) operator(+) predefined(min) comment(# 1:01:00) comment(#-----------------------------) comment(# For demo purposes only - the StrNum class is superfluous in this) comment(# case as plain strings would give the same result.) -keyword(class) ident(StrNum)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) +keyword(class) class(StrNum)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(value)operator(\))operator(:) pre_constant(self)operator(.)ident(value) operator(=) ident(value) - keyword(def) ident(__cmp__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# both <=> and cmp) + keyword(def) method(__cmp__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# both <=> and cmp) comment(# providing <=> gives us <, ==, etc. for free.) comment(# __lt__, __eq__, and __gt__ can also be individually specified) keyword(return) predefined(cmp)operator(()pre_constant(self)operator(.)ident(value)operator(,) ident(other)operator(.)ident(value)operator(\)) - keyword(def) ident(__str__)operator(()pre_constant(self)operator(\))operator(:) comment(# "") + keyword(def) method(__str__)operator(()pre_constant(self)operator(\))operator(:) comment(# "") keyword(return) pre_constant(self)operator(.)ident(value) - keyword(def) ident(__nonzero__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# bool) + keyword(def) method(__nonzero__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# bool) keyword(return) predefined(bool)operator(()pre_constant(self)operator(.)ident(value)operator(\)) - keyword(def) ident(__int__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# 0+) + keyword(def) method(__int__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# 0+) keyword(return) predefined(int)operator(()pre_constant(self)operator(.)ident(value)operator(\)) - keyword(def) ident(__add__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# +) + keyword(def) method(__add__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# +) keyword(return) ident(StrNum)operator(()pre_constant(self)operator(.)ident(value) operator(+) ident(other)operator(.)ident(value)operator(\)) - keyword(def) ident(__radd__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# +, inverted) + keyword(def) method(__radd__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# +, inverted) keyword(return) ident(StrNum)operator(()ident(other)operator(.)ident(value) operator(+) pre_constant(self)operator(.)ident(value)operator(\)) - keyword(def) ident(__mul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# *) + keyword(def) method(__mul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# *) keyword(return) ident(StrNum)operator(()pre_constant(self)operator(.)ident(value) operator(*) ident(other)operator(\)) - keyword(def) ident(__rmul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# *, inverted) + keyword(def) method(__rmul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# *, inverted) keyword(return) ident(StrNum)operator(()pre_constant(self)operator(.)ident(value) operator(*) ident(other)operator(\)) -keyword(def) ident(demo)operator(()operator(\))operator(:) +keyword(def) method(demo)operator(()operator(\))operator(:) comment(# show_strnum - demo operator overloading) ident(x) operator(=) ident(StrNum)operator(()string<delimiter(")content(Red)delimiter(")>operator(\)) ident(y) operator(=) ident(StrNum)operator(()string<delimiter(")content(Black)delimiter(")>operator(\)) @@ -8247,8 +8247,8 @@ ident(_places_re) operator(=) ident(re)operator(.)ident(compile)operator(()strin ident(default_places) operator(=) integer(0) -keyword(class) ident(FixNum)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(value)operator(,) ident(places) operator(=) pre_constant(None)operator(\))operator(:) +keyword(class) class(FixNum)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(value)operator(,) ident(places) operator(=) pre_constant(None)operator(\))operator(:) pre_constant(self)operator(.)ident(value) operator(=) ident(value) keyword(if) ident(places) keyword(is) pre_constant(None)operator(:) comment(# get from the value) @@ -8259,30 +8259,30 @@ keyword(class) ident(FixNum)operator(:) ident(places) operator(=) ident(default_places) pre_constant(self)operator(.)ident(places) operator(=) ident(places) - keyword(def) ident(__add__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__add__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) keyword(return) ident(FixNum)operator(()pre_constant(self)operator(.)ident(value) operator(+) ident(other)operator(.)ident(value)operator(,) predefined(max)operator(()pre_constant(self)operator(.)ident(places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - keyword(def) ident(__mul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__mul__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) keyword(return) ident(FixNum)operator(()pre_constant(self)operator(.)ident(value) operator(*) ident(other)operator(.)ident(value)operator(,) predefined(max)operator(()pre_constant(self)operator(.)ident(places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - keyword(def) ident(__div__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) + keyword(def) method(__div__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:) comment(# Force to use floating point, since 2/3 in Python is 0) comment(# Don't use float(\) since that will convert strings) keyword(return) ident(FixNum)operator(()operator(()pre_constant(self)operator(.)ident(value)operator(+)float(0.0)operator(\)) operator(/) ident(other)operator(.)ident(value)operator(,) predefined(max)operator(()pre_constant(self)operator(.)ident(places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - keyword(def) ident(__str__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__str__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) string<delimiter(")content(STR%s: %.*f)delimiter(")> operator(%) operator(()pre_constant(self)operator(.)ident(__class__)operator(.)ident(__name__)operator(,) pre_constant(self)operator(.)ident(places)operator(,) pre_constant(self)operator(.)ident(value)operator(\)) - keyword(def) ident(__int__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__int__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) predefined(int)operator(()pre_constant(self)operator(.)ident(value)operator(\)) - keyword(def) ident(__float__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__float__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(value) -keyword(def) ident(demo)operator(()operator(\))operator(:) +keyword(def) method(demo)operator(()operator(\))operator(:) ident(x) operator(=) ident(FixNum)operator(()integer(40)operator(\)) ident(y) operator(=) ident(FixNum)operator(()integer(12)operator(,) integer(0)operator(\)) @@ -8304,11 +8304,11 @@ keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)del comment(# ^^PLEAC^^_13.15) comment(# You can't tie a variable, but you can use properties. ) keyword(import) ident(itertools) -keyword(class) ident(ValueRing)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(colours)operator(\))operator(:) +keyword(class) class(ValueRing)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(colours)operator(\))operator(:) pre_constant(self)operator(.)ident(colourcycle) operator(=) ident(itertools)operator(.)ident(cycle)operator(()ident(colours)operator(\)) - keyword(def) ident(next_colour)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(next_colour)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(colourcycle)operator(.)ident(next)operator(()operator(\)) ident(colour) operator(=) predefined(property)operator(()ident(next_colour)operator(\)) ident(vr) operator(=) ident(ValueRing)operator(()operator([)string<delimiter(")content(red)delimiter(")>operator(,) string<delimiter(")content(blue)delimiter(")>operator(])operator(\)) @@ -8322,8 +8322,8 @@ keyword(print) ident(x)operator(,) ident(x)operator(,) ident(x) comment(#-------------------------------------) comment(# Ties are generally unnecessary in Python because of its strong OO support -) comment(# The resulting code is MUCH shorter:) -keyword(class) ident(AppendDict)operator(()predefined(dict)operator(\))operator(:) - keyword(def) ident(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(val)operator(\))operator(:) +keyword(class) class(AppendDict)operator(()predefined(dict)operator(\))operator(:) + keyword(def) method(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(val)operator(\))operator(:) keyword(if) ident(key) keyword(in) pre_constant(self)operator(:) pre_constant(self)operator([)ident(key)operator(])operator(.)ident(append)operator(()ident(val)operator(\)) keyword(else)operator(:) @@ -8336,10 +8336,10 @@ ident(tab)operator([)string<delimiter(")content(food)delimiter(")>operator(]) op keyword(for) ident(key)operator(,) ident(val) keyword(in) ident(tab)operator(.)ident(items)operator(()operator(\))operator(:) keyword(print) ident(key)operator(,) string<delimiter(")content(=>)delimiter(")>operator(,) ident(val) comment(#-------------------------------------) -keyword(class) ident(CaselessDict)operator(()predefined(dict)operator(\))operator(:) - keyword(def) ident(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(val)operator(\))operator(:) +keyword(class) class(CaselessDict)operator(()predefined(dict)operator(\))operator(:) + keyword(def) method(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(val)operator(\))operator(:) predefined(super)operator(()ident(CaselessDict)operator(,) pre_constant(self)operator(\))operator(.)ident(__setitem__)operator(()ident(key)operator(.)ident(lower)operator(()operator(\))operator(,) ident(val)operator(\)) - keyword(def) ident(__getitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\))operator(:) + keyword(def) method(__getitem__)operator(()pre_constant(self)operator(,) ident(key)operator(\))operator(:) keyword(return) predefined(super)operator(()ident(CaselessDict)operator(,) pre_constant(self)operator(\))operator(.)ident(__getitem__)operator(()ident(key)operator(.)ident(lower)operator(()operator(\))operator(\)) ident(tab) operator(=) ident(CaselessDict)operator(()operator(\)) @@ -8352,8 +8352,8 @@ keyword(for) ident(key)operator(,) ident(val) keyword(in) ident(tab)operator(.)i comment(#=>villain is bad wolf) comment(#=>heroine is red riding hood) comment(#-------------------------------------) -keyword(class) ident(RevDict)operator(()predefined(dict)operator(\))operator(:) - keyword(def) ident(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(val)operator(\))operator(:) +keyword(class) class(RevDict)operator(()predefined(dict)operator(\))operator(:) + keyword(def) method(__setitem__)operator(()pre_constant(self)operator(,) ident(key)operator(,) ident(val)operator(\))operator(:) predefined(super)operator(()ident(RevDict)operator(,) pre_constant(self)operator(\))operator(.)ident(__setitem__)operator(()ident(key)operator(,) ident(val)operator(\)) predefined(super)operator(()ident(RevDict)operator(,) pre_constant(self)operator(\))operator(.)ident(__setitem__)operator(()ident(val)operator(,) ident(key)operator(\)) @@ -8763,7 +8763,7 @@ comment(# @@PLEAC@@_15.2) comment(##------------------) keyword(import) ident(sys) -keyword(def) ident(is_interactive_python)operator(()operator(\))operator(:) +keyword(def) method(is_interactive_python)operator(()operator(\))operator(:) keyword(try)operator(:) ident(ps) operator(=) ident(sys)operator(.)ident(ps1) keyword(except)operator(:) @@ -8771,7 +8771,7 @@ keyword(def) ident(is_interactive_python)operator(()operator(\))operator(:) keyword(return) pre_constant(True) comment(##------------------) keyword(import) ident(sys) -keyword(def) ident(is_interactive)operator(()operator(\))operator(:) +keyword(def) method(is_interactive)operator(()operator(\))operator(:) comment(# only False if stdin is redirected like "-t" in perl.) keyword(return) ident(sys)operator(.)ident(stdin)operator(.)ident(isatty)operator(()operator(\)) @@ -8779,7 +8779,7 @@ comment(# Or take advantage of Python's Higher Order Functions:) ident(is_interactive) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(isatty) comment(##------------------) keyword(import) ident(posix) -keyword(def) ident(is_interactive_posix)operator(()operator(\))operator(:) +keyword(def) method(is_interactive_posix)operator(()operator(\))operator(:) ident(tty) operator(=) predefined(open)operator(()string<delimiter(")content(/dev/tty)delimiter(")>operator(\)) ident(tpgrp) operator(=) ident(posix)operator(.)ident(tcgetpgrp)operator(()ident(tty)operator(.)ident(fileno)operator(()operator(\))operator(\)) ident(pgrp) operator(=) ident(posix)operator(.)ident(getpgrp)operator(()operator(\)) @@ -8865,23 +8865,23 @@ comment(# @@PLEAC@@_15.6) comment(# Show ASCII values for keypresses) comment(# _Getch is from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892) -keyword(class) ident(_Getch)operator(:) +keyword(class) class(_Getch)operator(:) string<delimiter(""")content(Gets a single character from standard input. Doesn't echo to screen.)delimiter(""")> - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) keyword(try)operator(:) pre_constant(self)operator(.)ident(impl) operator(=) ident(_GetchWindows)operator(()operator(\)) keyword(except) exception(ImportError)operator(:) pre_constant(self)operator(.)ident(impl) operator(=) ident(_GetchUnix)operator(()operator(\)) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(impl)operator(()operator(\)) -keyword(class) ident(_GetchUnix)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(_GetchUnix)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) keyword(import) ident(tty)operator(,) ident(sys) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(\))operator(:) keyword(import) ident(sys)operator(,) ident(tty)operator(,) ident(termios) ident(fd) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(fileno)operator(()operator(\)) ident(old_settings) operator(=) ident(termios)operator(.)ident(tcgetattr)operator(()ident(fd)operator(\)) @@ -8893,11 +8893,11 @@ keyword(class) ident(_GetchUnix)operator(:) keyword(return) ident(ch) -keyword(class) ident(_GetchWindows)operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(_GetchWindows)operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) keyword(import) ident(msvcrt) - keyword(def) ident(__call__)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(__call__)operator(()pre_constant(self)operator(\))operator(:) keyword(import) ident(msvcrt) keyword(return) ident(msvcrt)operator(.)ident(getch)operator(()operator(\)) @@ -9103,7 +9103,7 @@ comment(# 5: EOF) comment(# @@PLEAC@@_15.14) keyword(from) ident(Tkinter) keyword(import) operator(*) -keyword(def) ident(print_callback)operator(()operator(\))operator(:) +keyword(def) method(print_callback)operator(()operator(\))operator(:) keyword(print) string<delimiter(")content(print_callback)delimiter(")> ident(main) operator(=) ident(Tk)operator(()operator(\)) @@ -9120,14 +9120,14 @@ ident(main)operator(.)ident(mainloop)operator(()operator(\)) comment(# using a class) keyword(from) ident(Tkinter) keyword(import) operator(*) -keyword(class) ident(Application)operator(()ident(Tk)operator(\))operator(:) - keyword(def) ident(print_callback)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(Application)operator(()ident(Tk)operator(\))operator(:) + keyword(def) method(print_callback)operator(()pre_constant(self)operator(\))operator(:) keyword(print) string<delimiter(")content(print_callback)delimiter(")> - keyword(def) ident(debug_callback)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(debug_callback)operator(()pre_constant(self)operator(\))operator(:) keyword(print) string<delimiter(")content(debug:)delimiter(")>operator(,) pre_constant(self)operator(.)ident(debug)operator(.)ident(get)operator(()operator(\)) keyword(print) string<delimiter(")content(debug level:)delimiter(")>operator(,) pre_constant(self)operator(.)ident(debug_level)operator(.)ident(get)operator(()operator(\)) - keyword(def) ident(createWidgets)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(createWidgets)operator(()pre_constant(self)operator(\))operator(:) ident(menubar) operator(=) ident(Menu)operator(()pre_constant(self)operator(\)) pre_constant(self)operator(.)ident(config)operator(()ident(menu)operator(=)ident(menubar)operator(\)) ident(file_menu) operator(=) ident(Menu)operator(()ident(menubar)operator(\)) @@ -9163,7 +9163,7 @@ keyword(class) ident(Application)operator(()ident(Tk)operator(\))operator(:) ident(value) operator(=) integer(3) operator(\)) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(master)operator(=)pre_constant(None)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(master)operator(=)pre_constant(None)operator(\))operator(:) ident(Tk)operator(.)ident(__init__)operator(()pre_constant(self)operator(,) ident(master)operator(\)) comment(# bound variables must be IntVar, StrVar, ...) pre_constant(self)operator(.)ident(debug) operator(=) ident(IntVar)operator(()operator(\)) @@ -9286,16 +9286,16 @@ ident(pipe)operator(.)ident(tochild)operator(.)ident(write)operator(()string<del ident(pipe)operator(.)ident(tochild)operator(.)ident(close)operator(()operator(\)) comment(# programm will get EOF on STDIN) comment(# @@PLEAC@@_16.5) -keyword(class) ident(OutputFilter)operator(()predefined(object)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(target)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwds)operator(\))operator(:) +keyword(class) class(OutputFilter)operator(()predefined(object)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(target)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwds)operator(\))operator(:) pre_constant(self)operator(.)ident(target) operator(=) ident(target) pre_constant(self)operator(.)ident(setup)operator(()operator(*)ident(args)operator(,) operator(**)ident(kwds)operator(\)) pre_constant(self)operator(.)ident(textbuffer) operator(=) string<delimiter(")delimiter(")> - keyword(def) ident(setup)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwds)operator(\))operator(:) + keyword(def) method(setup)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwds)operator(\))operator(:) keyword(pass) - keyword(def) ident(write)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(write)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(if) ident(data)operator(.)ident(endswith)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\))operator(:) ident(data) operator(=) pre_constant(self)operator(.)ident(process)operator(()pre_constant(self)operator(.)ident(textbuffer) operator(+) ident(data)operator(\)) pre_constant(self)operator(.)ident(textbuffer) operator(=) string<delimiter(")delimiter(")> @@ -9304,29 +9304,29 @@ keyword(class) ident(OutputFilter)operator(()predefined(object)operator(\))opera keyword(else)operator(:) pre_constant(self)operator(.)ident(textbuffer) operator(+=) ident(data) - keyword(def) ident(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(return) ident(data) -keyword(class) ident(HeadFilter)operator(()ident(OutputFilter)operator(\))operator(:) - keyword(def) ident(setup)operator(()pre_constant(self)operator(,) ident(maxcount)operator(\))operator(:) +keyword(class) class(HeadFilter)operator(()ident(OutputFilter)operator(\))operator(:) + keyword(def) method(setup)operator(()pre_constant(self)operator(,) ident(maxcount)operator(\))operator(:) pre_constant(self)operator(.)ident(count) operator(=) integer(0) pre_constant(self)operator(.)ident(maxcount) operator(=) ident(maxcount) - keyword(def) ident(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(if) pre_constant(self)operator(.)ident(count) operator(<) pre_constant(self)operator(.)ident(maxcount)operator(:) pre_constant(self)operator(.)ident(count) operator(+=) integer(1) keyword(return) ident(data) -keyword(class) ident(NumberFilter)operator(()ident(OutputFilter)operator(\))operator(:) - keyword(def) ident(setup)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(NumberFilter)operator(()ident(OutputFilter)operator(\))operator(:) + keyword(def) method(setup)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(count)operator(=)integer(0) - keyword(def) ident(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) pre_constant(self)operator(.)ident(count) operator(+=) integer(1) keyword(return) string<delimiter(")content(%s: %s)delimiter(")>operator(%)operator(()pre_constant(self)operator(.)ident(count)operator(,) ident(data)operator(\)) -keyword(class) ident(QuoteFilter)operator(()ident(OutputFilter)operator(\))operator(:) - keyword(def) ident(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) +keyword(class) class(QuoteFilter)operator(()ident(OutputFilter)operator(\))operator(:) + keyword(def) method(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(return) string<delimiter(")content(> )delimiter(")> operator(+) ident(data) keyword(import) ident(sys) @@ -9376,7 +9376,7 @@ comment(# Ask for filename and open it) keyword(import) ident(sys) keyword(print) string<delimiter(")content(File, please?)delimiter(")> ident(line) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(readline)operator(()operator(\)) -predefined(file) operator(=) ident(line)operator(.)ident(strip)operator(()operator(\)) comment(# chomp) +ident(file) operator(=) ident(line)operator(.)ident(strip)operator(()operator(\)) comment(# chomp) predefined(open)operator(()predefined(file)operator(\)) comment(# @@PLEAC@@_16.7) @@ -9438,7 +9438,7 @@ comment(# with os.kill(pid, signal\)) comment(# @@PLEAC@@_16.15) keyword(import) ident(signal) -keyword(def) ident(get_sig_quit)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) +keyword(def) method(get_sig_quit)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) operator(...)operator(.) ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SIGQUIT)operator(,) ident(get_sig_quit)operator(\)) comment(# Install handler) @@ -9452,7 +9452,7 @@ comment(# Example of handler: User must Enter Name ctrl-c does not help) keyword(import) ident(sys) keyword(import) ident(signal) -keyword(def) ident(ding)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) +keyword(def) method(ding)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) keyword(print) string<delimiter(")char(\\a)content(Enter your name!)delimiter(")> keyword(return) @@ -9479,7 +9479,7 @@ comment(# ignore signal INT) ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SIGINT)operator(,) ident(signal)operator(.)ident(SIG_IGN)operator(\)) comment(# Install signal handler) -keyword(def) ident(tsktsk)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) +keyword(def) method(tsktsk)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) keyword(print) string<delimiter(")content(...)delimiter(")> ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SIGINT)operator(,) ident(tsktsk)operator(\)) @@ -9495,7 +9495,7 @@ comment(# @@INCOMPLETE@@) comment(# @@PLEAC@@_16.21) keyword(import) ident(signal) -keyword(def) ident(handler)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) +keyword(def) method(handler)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) keyword(raise) string<delimiter(")content(timeout)delimiter(")> ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SIGALRM)operator(,) ident(handler)operator(\)) @@ -9564,8 +9564,8 @@ comment(# You can test it with "telnet localhost 1029") keyword(from) ident(SocketServer) keyword(import) ident(TCPServer) keyword(from) ident(SocketServer) keyword(import) ident(BaseRequestHandler) -keyword(class) ident(MyHandler)operator(()ident(BaseRequestHandler)operator(\))operator(:) - keyword(def) ident(handle)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(MyHandler)operator(()ident(BaseRequestHandler)operator(\))operator(:) + keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:) keyword(print) string<delimiter(")content(I got an request)delimiter(")> ident(server) operator(=) ident(TCPServer)operator(()operator(()string<delimiter(")content(127.0.0.1)delimiter(")>operator(,) integer(1029)operator(\))operator(,) ident(MyHandler)operator(\)) @@ -9578,8 +9578,8 @@ keyword(import) ident(time) keyword(from) ident(SocketServer) keyword(import) ident(TCPServer) keyword(from) ident(SocketServer) keyword(import) ident(BaseRequestHandler) -keyword(class) ident(MyHandler)operator(()ident(BaseRequestHandler)operator(\))operator(:) - keyword(def) ident(handle)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(MyHandler)operator(()ident(BaseRequestHandler)operator(\))operator(:) + keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:) comment(# self.request is the socket object) keyword(print) string<delimiter(")content(%s I got an request from ip=%s port=%s)delimiter(")> operator(%) operator(() ident(time)operator(.)ident(strftime)operator(()string<delimiter(")content(%Y-%m-%d %H:%M:%S)delimiter(")>operator(\))operator(,) @@ -9692,8 +9692,8 @@ ident(s)operator(.)ident(close)operator(()operator(\)) comment(# or ) keyword(import) ident(SocketServer) -keyword(class) ident(handler)operator(()ident(SocketServer)operator(.)ident(DatagramRequestHandler)operator(\))operator(:) - keyword(def) ident(handle)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(handler)operator(()ident(SocketServer)operator(.)ident(DatagramRequestHandler)operator(\))operator(:) + keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:) comment(# do something (with self.request[0]\)) ident(s) operator(=) ident(SocketServer)operator(.)ident(UDPServer)operator(()operator(()string<delimiter(')delimiter(')>operator(,)integer(10000)operator(\))operator(,) ident(handler)operator(\)) @@ -9707,8 +9707,8 @@ keyword(import) ident(SocketServer) ident(PORTNO) operator(=) integer(5151) -keyword(class) ident(handler)operator(()ident(SocketServer)operator(.)ident(DatagramRequestHandler)operator(\))operator(:) - keyword(def) ident(handle)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(handler)operator(()ident(SocketServer)operator(.)ident(DatagramRequestHandler)operator(\))operator(:) + keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:) ident(newmsg) operator(=) pre_constant(self)operator(.)ident(rfile)operator(.)ident(readline)operator(()operator(\))operator(.)ident(rstrip)operator(()operator(\)) keyword(print) string<delimiter(")content(Client %s said ``%s'')delimiter(")> operator(%) operator(()pre_constant(self)operator(.)ident(client_address)operator([)integer(0)operator(])operator(,) ident(newmsg)operator(\)) pre_constant(self)operator(.)ident(wfile)operator(.)ident(write)operator(()pre_constant(self)operator(.)ident(server)operator(.)ident(oldmsg)operator(\)) @@ -9835,7 +9835,7 @@ keyword(import) ident(sys) keyword(import) ident(time) keyword(import) ident(signal) -keyword(def) ident(phoenix)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) +keyword(def) method(phoenix)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) keyword(print) string<delimiter(")content(Restarting myself: %s %s)delimiter(")> operator(%) operator(()pre_constant(self)operator(,) ident(args)operator(\)) ident(os)operator(.)ident(execv)operator(()pre_constant(self)operator(,) ident(args)operator(\)) @@ -9853,7 +9853,7 @@ keyword(import) ident(signal) ident(config_file) operator(=) string<delimiter(")content(/usr/local/etc/myprog/server_conf.py)delimiter(")> -keyword(def) ident(read_config)operator(()operator(\))operator(:) +keyword(def) method(read_config)operator(()operator(\))operator(:) predefined(execfile)operator(()ident(config_file)operator(\)) ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SIGHUP)operator(,) ident(read_config)operator(\)) @@ -9888,7 +9888,7 @@ keyword(else)operator(:) comment(# ----------------------------) comment(# setsid (Unix\): Create a new session) keyword(import) ident(os) -predefined(id)operator(=)ident(os)operator(.)ident(setsid)operator(()operator(\)) +ident(id)operator(=)ident(os)operator(.)ident(setsid)operator(()operator(\)) comment(# ----------------------------) comment(# Work until INT TERM or HUP signal is received) @@ -9897,7 +9897,7 @@ keyword(import) ident(signal) ident(time_to_die) operator(=) integer(0) -keyword(def) ident(sighandler)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) +keyword(def) method(sighandler)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:) keyword(print) string<delimiter(")content(time to die)delimiter(")> keyword(global) ident(time_to_die) ident(time_to_die) operator(=) integer(1) @@ -10271,7 +10271,7 @@ operator(<)operator(/)ident(Directory)operator(>) comment(# test.py file in /some/directory/htdocs/test) keyword(from) ident(mod_python) keyword(import) ident(apache) -keyword(def) ident(handler)operator(()ident(req)operator(\))operator(:) +keyword(def) method(handler)operator(()ident(req)operator(\))operator(:) ident(req)operator(.)ident(write)operator(()string<delimiter(")content(Hello World!)delimiter(")>operator(\)) keyword(return) ident(apache)operator(.)ident(OK) @@ -10306,7 +10306,7 @@ keyword(print) ident(T)operator(.)ident(ol)operator([)ident(T)operator(.)ident(l comment(# <ol><li>red</li><li>blue</li><li>green</li></ol>) ident(names) operator(=) string<delimiter(')content(Larry Moe Curly)delimiter(')>operator(.)ident(split)operator(()operator(\)) -keyword(print) ident(T)operator(.)ident(ul)operator([) operator([)ident(T)operator(.)ident(li)operator(()predefined(type)operator(=)string<delimiter(")content(disc)delimiter(")>operator(\))operator([)ident(name)operator(]) keyword(for) ident(name) keyword(in) ident(names)operator(]) operator(]) +keyword(print) ident(T)operator(.)ident(ul)operator([) operator([)ident(T)operator(.)ident(li)operator(()ident(type)operator(=)string<delimiter(")content(disc)delimiter(")>operator(\))operator([)ident(name)operator(]) keyword(for) ident(name) keyword(in) ident(names)operator(]) operator(]) comment(# <ul><li type="disc">Larry</li><li type="disc">Moe</li>) comment(# <li type="disc">Curly</li></ul>) comment(#-----------------------------) @@ -10374,8 +10374,8 @@ keyword(print) string<delimiter(')content(<html><head><title>Salary Query</title keyword(print) ident(T)operator(.)ident(h1)operator([)string<delimiter(')content(Search)delimiter(')>operator(]) keyword(print) string<delimiter(')content(<form>)delimiter(')> keyword(print) ident(T)operator(.)ident(p)operator([)string<delimiter(')content(Enter minimum salary)delimiter(')>operator(,) - ident(T)operator(.)ident(input)operator(()predefined(type)operator(=)string<delimiter(")content(text)delimiter(")>operator(,) ident(name)operator(=)string<delimiter(")content(limit)delimiter(")>operator(,) ident(value)operator(=)ident(limit)operator(\))operator(]) -keyword(print) ident(T)operator(.)ident(input)operator(()predefined(type)operator(=)string<delimiter(")content(submit)delimiter(")>operator(\)) + ident(T)operator(.)ident(input)operator(()ident(type)operator(=)string<delimiter(")content(text)delimiter(")>operator(,) ident(name)operator(=)string<delimiter(")content(limit)delimiter(")>operator(,) ident(value)operator(=)ident(limit)operator(\))operator(]) +keyword(print) ident(T)operator(.)ident(input)operator(()ident(type)operator(=)string<delimiter(")content(submit)delimiter(")>operator(\)) keyword(print) string<delimiter(')content(</form>)delimiter(')> keyword(if) ident(limit)operator(:) @@ -10434,7 +10434,7 @@ comment(#Location: http://somewhere.perl.com/nonesuch.html) comment(#-----------------------------) comment(# os_snipe - redirect to a Jargon File entry about current OS) keyword(import) ident(os)operator(,) ident(re) -predefined(dir) operator(=) string<delimiter(')content(http://www.wins.uva.nl/%7Emes/jargon)delimiter(')> +ident(dir) operator(=) string<delimiter(')content(http://www.wins.uva.nl/%7Emes/jargon)delimiter(')> ident(matches) operator(=) operator([) operator(()string<modifier(r)delimiter(')content(Mac)delimiter(')>operator(,) string<delimiter(')content(m/Macintrash.html)delimiter(')>operator(\))operator(,) operator(()string<modifier(r)delimiter(')content(Win(dows \)?NT)delimiter(')>operator(,) string<delimiter(')content(e/evilandrude.html)delimiter(')>operator(\))operator(,) @@ -10467,11 +10467,11 @@ comment(# dummyhttpd - start a HTTP daemon and print what the client sends) keyword(import) ident(SocketServer) comment(# or use BaseHTTPServer, SimpleHTTPServer, CGIHTTPServer) -keyword(def) ident(adr_str)operator(()ident(adr)operator(\))operator(:) +keyword(def) method(adr_str)operator(()ident(adr)operator(\))operator(:) keyword(return) string<delimiter(")content(%s:%d)delimiter(")> operator(%) ident(adr) -keyword(class) ident(RequestHandler)operator(()ident(SocketServer)operator(.)ident(BaseRequestHandler)operator(\))operator(:) - keyword(def) ident(handle)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(RequestHandler)operator(()ident(SocketServer)operator(.)ident(BaseRequestHandler)operator(\))operator(:) + keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:) keyword(print) string<delimiter(")content(client access from %s)delimiter(")> operator(%) ident(adr_str)operator(()pre_constant(self)operator(.)ident(client_address)operator(\)) keyword(print) pre_constant(self)operator(.)ident(request)operator(.)ident(recv)operator(()integer(10000)operator(\)) pre_constant(self)operator(.)ident(request)operator(.)ident(send)operator(()string<delimiter(")content(Content-Type: text/plain)char(\\n)delimiter(")> @@ -10647,20 +10647,20 @@ comment(# ftp.funet.fi -> ftp://ftp.funet.fi) comment(# /etc/passwd -> file:/etc/passwd) comment(# simple but pedantic html parser: tpj.com breaks it.) -keyword(class) ident(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) ident(HTMLParser)operator(.)ident(HTMLParser)operator(.)ident(__init__)operator(()pre_constant(self)operator(\)) pre_constant(self)operator(.)ident(_data) operator(=) operator({)operator(}) pre_constant(self)operator(.)ident(_open_tags) operator(=) operator([)operator(]) - keyword(def) ident(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) + keyword(def) method(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) pre_constant(self)operator(.)ident(_open_tags)operator(.)ident(append)operator(()ident(tag)operator(\)) - keyword(def) ident(handle_endtag)operator(()pre_constant(self)operator(,) ident(tag)operator(\))operator(:) + keyword(def) method(handle_endtag)operator(()pre_constant(self)operator(,) ident(tag)operator(\))operator(:) keyword(if) predefined(len)operator(()pre_constant(self)operator(.)ident(_open_tags)operator(\))operator(>)integer(0)operator(:) pre_constant(self)operator(.)ident(_open_tags)operator(.)ident(pop)operator(()operator(\)) - keyword(def) ident(handle_data)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(handle_data)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(if) predefined(len)operator(()pre_constant(self)operator(.)ident(_open_tags)operator(\))operator(>)integer(0)operator(:) pre_constant(self)operator(.)ident(_data)operator([)pre_constant(self)operator(.)ident(_open_tags)operator([)operator(-)integer(1)operator(])operator(]) operator(=) ident(data) - keyword(def) ident(__getattr__)operator(()pre_constant(self)operator(,)ident(attr)operator(\))operator(:) + keyword(def) method(__getattr__)operator(()pre_constant(self)operator(,)ident(attr)operator(\))operator(:) keyword(if) keyword(not) pre_constant(self)operator(.)ident(_data)operator(.)ident(has_key)operator(()ident(attr)operator(\))operator(:) keyword(return) string<delimiter(")delimiter(")> keyword(return) pre_constant(self)operator(.)ident(_data)operator([)ident(attr)operator(]) @@ -10681,7 +10681,7 @@ ident(parser) operator(=) ident(html)operator(()operator(\)) ident(parser)operator(.)ident(feed)operator(()ident(data)operator(\)) ident(parser)operator(.)ident(close)operator(()operator(\)) comment(# force processing all data) ident(count) operator(=) predefined(len)operator(()ident(data)operator(.)ident(split)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\))operator(\)) -predefined(bytes) operator(=) predefined(len)operator(()ident(data)operator(\)) +ident(bytes) operator(=) predefined(len)operator(()ident(data)operator(\)) keyword(print) string<delimiter(")content(%s (%d lines, %d bytes\))delimiter(")> operator(%) operator(()ident(parser)operator(.)ident(title)operator(,) ident(count)operator(,) predefined(bytes)operator(\)) @@ -10717,14 +10717,14 @@ comment(# xurl - extract unique, sorted list of links from URL) keyword(from) ident(HTMLParser) keyword(import) ident(HTMLParser) keyword(import) ident(urllib) keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) comment(# not needed in 2.4) -keyword(class) ident(myParser)operator(()ident(HTMLParser)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(url)operator(\))operator(:) +keyword(class) class(myParser)operator(()ident(HTMLParser)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(url)operator(\))operator(:) pre_constant(self)operator(.)ident(baseUrl) operator(=) ident(url)operator([)operator(:)ident(url)operator(.)ident(rfind)operator(()string<delimiter(')content(/)delimiter(')>operator(\))operator(]) ident(HTMLParser)operator(.)ident(__init__)operator(()pre_constant(self)operator(\)) - keyword(def) ident(reset)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(reset)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(urls) operator(=) predefined(set)operator(()operator(\)) ident(HTMLParser)operator(.)ident(reset)operator(()pre_constant(self)operator(\)) - keyword(def) ident(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) + keyword(def) method(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) keyword(if) ident(tag) operator(==) string<delimiter(')content(a)delimiter(')>operator(:) keyword(if) ident(attrs)operator([)integer(0)operator(])operator([)integer(0)operator(]) operator(==) string<delimiter(')content(href)delimiter(')>operator(:) keyword(if) ident(attrs)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(.)ident(find)operator(()string<delimiter(')content(:)delimiter(')>operator(\)) operator(==) operator(-)integer(1)operator(:) @@ -10779,7 +10779,7 @@ comment(#-----------------------------) keyword(import) ident(sys)operator(,) ident(re) keyword(import) ident(htmlentitydefs) -keyword(def) ident(encode_entities)operator(()ident(s)operator(\))operator(:) +keyword(def) method(encode_entities)operator(()ident(s)operator(\))operator(:) keyword(for) ident(k)operator(,)ident(v) keyword(in) ident(htmlentitydefs)operator(.)ident(codepoint2name)operator(.)ident(items)operator(()operator(\))operator(:) keyword(if) ident(k)operator(<)integer(256)operator(:) comment(# no unicodes) ident(s) operator(=) ident(s)operator(.)ident(replace)operator(()predefined(chr)operator(()ident(k)operator(\))operator(,)string<delimiter(")content(&%s;)delimiter(")>operator(%)ident(v)operator(\)) @@ -10831,23 +10831,23 @@ ident(plain_text) operator(=) ident(re)operator(.)ident(sub)operator(()string<mo comment(# using HTMLParser) keyword(import) ident(sys)operator(,) ident(HTMLParser) -keyword(class) ident(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) ident(HTMLParser)operator(.)ident(HTMLParser)operator(.)ident(__init__)operator(()pre_constant(self)operator(\)) pre_constant(self)operator(.)ident(_plaintext) operator(=) string<delimiter(")delimiter(")> pre_constant(self)operator(.)ident(_ignore) operator(=) pre_constant(False) - keyword(def) ident(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) + keyword(def) method(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) keyword(if) ident(tag) operator(==) string<delimiter(")content(script)delimiter(")>operator(:) pre_constant(self)operator(.)ident(_ignore) operator(=) pre_constant(True) - keyword(def) ident(handle_endtag)operator(()pre_constant(self)operator(,) ident(tag)operator(\))operator(:) + keyword(def) method(handle_endtag)operator(()pre_constant(self)operator(,) ident(tag)operator(\))operator(:) keyword(if) ident(tag) operator(==) string<delimiter(")content(script)delimiter(")>operator(:) pre_constant(self)operator(.)ident(_ignore) operator(=) pre_constant(False) - keyword(def) ident(handle_data)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(handle_data)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(if) predefined(len)operator(()ident(data)operator(\))operator(>)integer(0) keyword(and) keyword(not) pre_constant(self)operator(.)ident(_ignore)operator(:) pre_constant(self)operator(.)ident(_plaintext) operator(+=) ident(data) - keyword(def) ident(get_plaintext)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(get_plaintext)operator(()pre_constant(self)operator(\))operator(:) keyword(return) pre_constant(self)operator(.)ident(_plaintext) - keyword(def) ident(error)operator(()pre_constant(self)operator(,)ident(msg)operator(\))operator(:) + keyword(def) method(error)operator(()pre_constant(self)operator(,)ident(msg)operator(\))operator(:) comment(# ignore all errors) keyword(pass) @@ -10872,24 +10872,24 @@ keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\ ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\)) comment(# simple but pedantic html parser: tpj.com breaks it.) -keyword(class) ident(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(\))operator(:) +keyword(class) class(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:) ident(HTMLParser)operator(.)ident(HTMLParser)operator(.)ident(__init__)operator(()pre_constant(self)operator(\)) pre_constant(self)operator(.)ident(_data) operator(=) operator({)operator(}) pre_constant(self)operator(.)ident(_open_tags) operator(=) operator([)operator(]) - keyword(def) ident(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) + keyword(def) method(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) pre_constant(self)operator(.)ident(_open_tags)operator(.)ident(append)operator(()ident(tag)operator(\)) - keyword(def) ident(handle_endtag)operator(()pre_constant(self)operator(,) ident(tag)operator(\))operator(:) + keyword(def) method(handle_endtag)operator(()pre_constant(self)operator(,) ident(tag)operator(\))operator(:) keyword(if) predefined(len)operator(()pre_constant(self)operator(.)ident(_open_tags)operator(\))operator(>)integer(0)operator(:) pre_constant(self)operator(.)ident(_open_tags)operator(.)ident(pop)operator(()operator(\)) - keyword(def) ident(handle_data)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) + keyword(def) method(handle_data)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:) keyword(if) predefined(len)operator(()pre_constant(self)operator(.)ident(_open_tags)operator(\))operator(>)integer(0)operator(:) pre_constant(self)operator(.)ident(_data)operator([)pre_constant(self)operator(.)ident(_open_tags)operator([)operator(-)integer(1)operator(])operator(]) operator(=) ident(data) - keyword(def) ident(__getattr__)operator(()pre_constant(self)operator(,)ident(attr)operator(\))operator(:) + keyword(def) method(__getattr__)operator(()pre_constant(self)operator(,)ident(attr)operator(\))operator(:) keyword(if) keyword(not) pre_constant(self)operator(.)ident(_data)operator(.)ident(has_key)operator(()ident(attr)operator(\))operator(:) keyword(return) string<delimiter(")delimiter(")> keyword(return) pre_constant(self)operator(.)ident(_data)operator([)ident(attr)operator(]) - keyword(def) ident(error)operator(()pre_constant(self)operator(,)ident(msg)operator(\))operator(:) + keyword(def) method(error)operator(()pre_constant(self)operator(,)ident(msg)operator(\))operator(:) comment(# ignore all errors) keyword(pass) @@ -10920,7 +10920,7 @@ keyword(import) ident(sys) comment(# head request) keyword(import) ident(urllib) -keyword(def) ident(valid)operator(()ident(url)operator(\))operator(:) +keyword(def) method(valid)operator(()ident(url)operator(\))operator(:) keyword(try)operator(:) ident(conn) operator(=) ident(urllib)operator(.)ident(urlopen)operator(()ident(url)operator(\)) keyword(return) integer(1) @@ -10930,14 +10930,14 @@ keyword(def) ident(valid)operator(()ident(url)operator(\))operator(:) comment(# parser class as in xurl) keyword(from) ident(HTMLParser) keyword(import) ident(HTMLParser) keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) comment(# not needed in 2.4) -keyword(class) ident(myParser)operator(()ident(HTMLParser)operator(\))operator(:) - keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(url)operator(\))operator(:) +keyword(class) class(myParser)operator(()ident(HTMLParser)operator(\))operator(:) + keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(url)operator(\))operator(:) pre_constant(self)operator(.)ident(baseUrl) operator(=) ident(url)operator([)operator(:)ident(url)operator(.)ident(rfind)operator(()string<delimiter(')content(/)delimiter(')>operator(\))operator(]) ident(HTMLParser)operator(.)ident(__init__)operator(()pre_constant(self)operator(\)) - keyword(def) ident(reset)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) method(reset)operator(()pre_constant(self)operator(\))operator(:) pre_constant(self)operator(.)ident(urls) operator(=) predefined(set)operator(()operator(\)) ident(HTMLParser)operator(.)ident(reset)operator(()pre_constant(self)operator(\)) - keyword(def) ident(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) + keyword(def) method(handle_starttag)operator(()pre_constant(self)operator(,) ident(tag)operator(,) ident(attrs)operator(\))operator(:) keyword(if) ident(tag) operator(==) string<delimiter(')content(a)delimiter(')>operator(:) keyword(if) ident(attrs)operator([)integer(0)operator(])operator([)integer(0)operator(]) operator(==) string<delimiter(')content(href)delimiter(')>operator(:) keyword(if) ident(attrs)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(.)ident(find)operator(()string<delimiter(')content(:)delimiter(')>operator(\)) operator(==) operator(-)integer(1)operator(:) @@ -11001,9 +11001,9 @@ keyword(for) ident(d) keyword(in) ident(dates)operator(:) comment(# @@PLEAC@@_20.9) keyword(import) ident(re) -keyword(def) ident(template)operator(()ident(filename)operator(,) ident(fillings)operator(\))operator(:) +keyword(def) method(template)operator(()ident(filename)operator(,) ident(fillings)operator(\))operator(:) ident(text) operator(=) predefined(open)operator(()ident(filename)operator(\))operator(.)ident(read)operator(()operator(\)) - keyword(def) ident(repl)operator(()ident(matchobj)operator(\))operator(:) + keyword(def) method(repl)operator(()ident(matchobj)operator(\))operator(:) keyword(if) ident(fillings)operator(.)ident(has_key)operator(()ident(matchobj)operator(.)ident(group)operator(()integer(1)operator(\))operator(\))operator(:) keyword(return) predefined(str)operator(()ident(fillings)operator([)ident(matchobj)operator(.)ident(group)operator(()integer(1)operator(\))operator(])operator(\)) keyword(return) string<delimiter(")delimiter(")> @@ -11023,9 +11023,9 @@ keyword(import) ident(cgi) keyword(import) ident(re) keyword(import) ident(sys) -keyword(def) ident(template)operator(()ident(filename)operator(,) ident(fillings)operator(\))operator(:) +keyword(def) method(template)operator(()ident(filename)operator(,) ident(fillings)operator(\))operator(:) ident(text) operator(=) predefined(open)operator(()ident(filename)operator(\))operator(.)ident(read)operator(()operator(\)) - keyword(def) ident(repl)operator(()ident(matchobj)operator(\))operator(:) + keyword(def) method(repl)operator(()ident(matchobj)operator(\))operator(:) keyword(if) ident(fillings)operator(.)ident(has_key)operator(()ident(matchobj)operator(.)ident(group)operator(()integer(1)operator(\))operator(\))operator(:) keyword(return) predefined(str)operator(()ident(fillings)operator([)ident(matchobj)operator(.)ident(group)operator(()integer(1)operator(\))operator(])operator(\)) keyword(return) string<delimiter(")delimiter(")> @@ -11039,7 +11039,7 @@ keyword(if) keyword(not) ident(fields)operator(.)ident(has_key)operator(()string keyword(print) string<delimiter(")content(No username)delimiter(")> ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\)) -keyword(def) ident(get_userdata)operator(()ident(username)operator(\))operator(:) +keyword(def) method(get_userdata)operator(()ident(username)operator(\))operator(:) ident(db) operator(=) ident(MySQLdb)operator(.)ident(connect)operator(()ident(passwd)operator(=)string<delimiter(")delimiter(")>operator(,)ident(db)operator(=)string<delimiter(")content(connections)delimiter(")>operator(,) ident(user)operator(=)string<delimiter(")content(bert)delimiter(")>operator(\)) ident(db)operator(.)ident(query)operator(()string<delimiter(")content(select count(duration\) as count,)delimiter(")> operator(+)string<delimiter(")content( sum(duration\) as total from logins)delimiter(")> diff --git a/test/scanners/python/unistring.expected.raydebug b/test/scanners/python/unistring.expected.raydebug index aaf2372..2a88b8e 100644 --- a/test/scanners/python/unistring.expected.raydebug +++ b/test/scanners/python/unistring.expected.raydebug @@ -78,14 +78,14 @@ ident(Zs) operator(=) string<modifier(u)delimiter(')content( )char(\\xa0)char(\\ ident(cats) operator(=) operator([)string<delimiter(')content(Cc)delimiter(')>operator(,) string<delimiter(')content(Cf)delimiter(')>operator(,) string<delimiter(')content(Cn)delimiter(')>operator(,) string<delimiter(')content(Co)delimiter(')>operator(,) string<delimiter(')content(Cs)delimiter(')>operator(,) string<delimiter(')content(Ll)delimiter(')>operator(,) string<delimiter(')content(Lm)delimiter(')>operator(,) string<delimiter(')content(Lo)delimiter(')>operator(,) string<delimiter(')content(Lt)delimiter(')>operator(,) string<delimiter(')content(Lu)delimiter(')>operator(,) string<delimiter(')content(Mc)delimiter(')>operator(,) string<delimiter(')content(Me)delimiter(')>operator(,) string<delimiter(')content(Mn)delimiter(')>operator(,) string<delimiter(')content(Nd)delimiter(')>operator(,) string<delimiter(')content(Nl)delimiter(')>operator(,) string<delimiter(')content(No)delimiter(')>operator(,) string<delimiter(')content(Pc)delimiter(')>operator(,) string<delimiter(')content(Pd)delimiter(')>operator(,) string<delimiter(')content(Pe)delimiter(')>operator(,) string<delimiter(')content(Pf)delimiter(')>operator(,) string<delimiter(')content(Pi)delimiter(')>operator(,) string<delimiter(')content(Po)delimiter(')>operator(,) string<delimiter(')content(Ps)delimiter(')>operator(,) string<delimiter(')content(Sc)delimiter(')>operator(,) string<delimiter(')content(Sk)delimiter(')>operator(,) string<delimiter(')content(Sm)delimiter(')>operator(,) string<delimiter(')content(So)delimiter(')>operator(,) string<delimiter(')content(Zl)delimiter(')>operator(,) string<delimiter(')content(Zp)delimiter(')>operator(,) string<delimiter(')content(Zs)delimiter(')>operator(]) -keyword(def) ident(combine)operator(()operator(*)ident(args)operator(\))operator(:) +keyword(def) method(combine)operator(()operator(*)ident(args)operator(\))operator(:) keyword(return) string<modifier(u)delimiter(')delimiter(')>operator(.)ident(join)operator(()operator([)predefined(globals)operator(()operator(\))operator([)ident(cat)operator(]) keyword(for) ident(cat) keyword(in) ident(args)operator(])operator(\)) ident(xid_start) operator(=) string<modifier(u)delimiter(')char(\\u0041)content(-)char(\\u005A)char(\\u005F)char(\\u0061)content(-)char(\\u007A)char(\\u00AA)char(\\u00B5)char(\\u00BA)char(\\u00C0)content(-)char(\\u00D6)char(\\u00D8)content(-)char(\\u00F6)char(\\u00F8)content(-)char(\\u01BA)char(\\u01BB)char(\\u01BC)content(-)char(\\u01BF)char(\\u01C0)content(-)char(\\u01C3)char(\\u01C4)content(-)char(\\u0241)char(\\u0250)content(-)char(\\u02AF)char(\\u02B0)content(-)char(\\u02C1)char(\\u02C6)content(-)char(\\u02D1)char(\\u02E0)content(-)char(\\u02E4)char(\\u02EE)char(\\u0386)char(\\u0388)content(-)char(\\u038A)char(\\u038C)char(\\u038E)content(-)char(\\u03A1)char(\\u03A3)content(-)char(\\u03CE)char(\\u03D0)content(-)char(\\u03F5)char(\\u03F7)content(-)char(\\u0481)char(\\u048A)content(-)char(\\u04CE)char(\\u04D0)content(-)char(\\u04F9)char(\\u0500)content(-)char(\\u050F)char(\\u0531)content(-)char(\\u0556)char(\\u0559)char(\\u0561)content(-)char(\\u0587)char(\\u05D0)content(-)char(\\u05EA)char(\\u05F0)content(-)char(\\u05F2)char(\\u0621)content(-)char(\\u063A)char(\\u0640)char(\\u0641)content(-)char(\\u064A)char(\\u066E)content(-)char(\\u066F)char(\\u0671)content(-)char(\\u06D3)char(\\u06D5)char(\\u06E5)content(-)char(\\u06E6)char(\\u06EE)content(-)char(\\u06EF)char(\\u06FA)content(-)char(\\u06FC)char(\\u06FF)char(\\u0710)char(\\u0712)content(-)char(\\u072F)char(\\u074D)content(-)char(\\u076D)char(\\u0780)content(-)char(\\u07A5)char(\\u07B1)char(\\u0904)content(-)char(\\u0939)char(\\u093D)char(\\u0950)char(\\u0958)content(-)char(\\u0961)char(\\u097D)char(\\u0985)content(-)char(\\u098C)char(\\u098F)content(-)char(\\u0990)char(\\u0993)content(-)char(\\u09A8)char(\\u09AA)content(-)char(\\u09B0)char(\\u09B2)char(\\u09B6)content(-)char(\\u09B9)char(\\u09BD)char(\\u09CE)char(\\u09DC)content(-)char(\\u09DD)char(\\u09DF)content(-)char(\\u09E1)char(\\u09F0)content(-)char(\\u09F1)char(\\u0A05)content(-)char(\\u0A0A)char(\\u0A0F)content(-)char(\\u0A10)char(\\u0A13)content(-)char(\\u0A28)char(\\u0A2A)content(-)char(\\u0A30)char(\\u0A32)content(-)char(\\u0A33)char(\\u0A35)content(-)char(\\u0A36)char(\\u0A38)content(-)char(\\u0A39)char(\\u0A59)content(-)char(\\u0A5C)char(\\u0A5E)char(\\u0A72)content(-)char(\\u0A74)char(\\u0A85)content(-)char(\\u0A8D)char(\\u0A8F)content(-)char(\\u0A91)char(\\u0A93)content(-)char(\\u0AA8)char(\\u0AAA)content(-)char(\\u0AB0)char(\\u0AB2)content(-)char(\\u0AB3)char(\\u0AB5)content(-)char(\\u0AB9)char(\\u0ABD)char(\\u0AD0)char(\\u0AE0)content(-)char(\\u0AE1)char(\\u0B05)content(-)char(\\u0B0C)char(\\u0B0F)content(-)char(\\u0B10)char(\\u0B13)content(-)char(\\u0B28)char(\\u0B2A)content(-)char(\\u0B30)char(\\u0B32)content(-)char(\\u0B33)char(\\u0B35)content(-)char(\\u0B39)char(\\u0B3D)char(\\u0B5C)content(-)char(\\u0B5D)char(\\u0B5F)content(-)char(\\u0B61)char(\\u0B71)char(\\u0B83)char(\\u0B85)content(-)char(\\u0B8A)char(\\u0B8E)content(-)char(\\u0B90)char(\\u0B92)content(-)char(\\u0B95)char(\\u0B99)content(-)char(\\u0B9A)char(\\u0B9C)char(\\u0B9E)content(-)char(\\u0B9F)char(\\u0BA3)content(-)char(\\u0BA4)char(\\u0BA8)content(-)char(\\u0BAA)char(\\u0BAE)content(-)char(\\u0BB9)char(\\u0C05)content(-)char(\\u0C0C)char(\\u0C0E)content(-)char(\\u0C10)char(\\u0C12)content(-)char(\\u0C28)char(\\u0C2A)content(-)char(\\u0C33)char(\\u0C35)content(-)char(\\u0C39)char(\\u0C60)content(-)char(\\u0C61)char(\\u0C85)content(-)char(\\u0C8C)char(\\u0C8E)content(-)char(\\u0C90)char(\\u0C92)content(-)char(\\u0CA8)char(\\u0CAA)content(-)char(\\u0CB3)char(\\u0CB5)content(-)char(\\u0CB9)char(\\u0CBD)char(\\u0CDE)char(\\u0CE0)content(-)char(\\u0CE1)char(\\u0D05)content(-)char(\\u0D0C)char(\\u0D0E)content(-)char(\\u0D10)char(\\u0D12)content(-)char(\\u0D28)char(\\u0D2A)content(-)char(\\u0D39)char(\\u0D60)content(-)char(\\u0D61)char(\\u0D85)content(-)char(\\u0D96)char(\\u0D9A)content(-)char(\\u0DB1)char(\\u0DB3)content(-)char(\\u0DBB)char(\\u0DBD)char(\\u0DC0)content(-)char(\\u0DC6)char(\\u0E01)content(-)char(\\u0E30)char(\\u0E32)char(\\u0E40)content(-)char(\\u0E45)char(\\u0E46)char(\\u0E81)content(-)char(\\u0E82)char(\\u0E84)char(\\u0E87)content(-)char(\\u0E88)char(\\u0E8A)char(\\u0E8D)char(\\u0E94)content(-)char(\\u0E97)char(\\u0E99)content(-)char(\\u0E9F)char(\\u0EA1)content(-)char(\\u0EA3)char(\\u0EA5)char(\\u0EA7)char(\\u0EAA)content(-)char(\\u0EAB)char(\\u0EAD)content(-)char(\\u0EB0)char(\\u0EB2)char(\\u0EBD)char(\\u0EC0)content(-)char(\\u0EC4)char(\\u0EC6)char(\\u0EDC)content(-)char(\\u0EDD)char(\\u0F00)char(\\u0F40)content(-)char(\\u0F47)char(\\u0F49)content(-)char(\\u0F6A)char(\\u0F88)content(-)char(\\u0F8B)char(\\u1000)content(-)char(\\u1021)char(\\u1023)content(-)char(\\u1027)char(\\u1029)content(-)char(\\u102A)char(\\u1050)content(-)char(\\u1055)char(\\u10A0)content(-)char(\\u10C5)char(\\u10D0)content(-)char(\\u10FA)char(\\u10FC)char(\\u1100)content(-)char(\\u1159)char(\\u115F)content(-)char(\\u11A2)char(\\u11A8)content(-)char(\\u11F9)char(\\u1200)content(-)char(\\u1248)char(\\u124A)content(-)char(\\u124D)char(\\u1250)content(-)char(\\u1256)char(\\u1258)char(\\u125A)content(-)char(\\u125D)char(\\u1260)content(-)char(\\u1288)char(\\u128A)content(-)char(\\u128D)char(\\u1290)content(-)char(\\u12B0)char(\\u12B2)content(-)char(\\u12B5)char(\\u12B8)content(-)char(\\u12BE)char(\\u12C0)char(\\u12C2)content(-)char(\\u12C5)char(\\u12C8)content(-)char(\\u12D6)char(\\u12D8)content(-)char(\\u1310)char(\\u1312)content(-)char(\\u1315)char(\\u1318)content(-)char(\\u135A)char(\\u1380)content(-)char(\\u138F)char(\\u13A0)content(-)char(\\u13F4)char(\\u1401)content(-)char(\\u166C)char(\\u166F)content(-)char(\\u1676)char(\\u1681)content(-)char(\\u169A)char(\\u16A0)content(-)char(\\u16EA)char(\\u16EE)content(-)char(\\u16F0)char(\\u1700)content(-)char(\\u170C)char(\\u170E)content(-)char(\\u1711)char(\\u1720)content(-)char(\\u1731)char(\\u1740)content(-)char(\\u1751)char(\\u1760)content(-)char(\\u176C)char(\\u176E)content(-)char(\\u1770)char(\\u1780)content(-)char(\\u17B3)char(\\u17D7)char(\\u17DC)char(\\u1820)content(-)char(\\u1842)char(\\u1843)char(\\u1844)content(-)char(\\u1877)char(\\u1880)content(-)char(\\u18A8)char(\\u1900)content(-)char(\\u191C)char(\\u1950)content(-)char(\\u196D)char(\\u1970)content(-)char(\\u1974)char(\\u1980)content(-)char(\\u19A9)char(\\u19C1)content(-)char(\\u19C7)char(\\u1A00)content(-)char(\\u1A16)char(\\u1D00)content(-)char(\\u1D2B)char(\\u1D2C)content(-)char(\\u1D61)char(\\u1D62)content(-)char(\\u1D77)char(\\u1D78)char(\\u1D79)content(-)char(\\u1D9A)char(\\u1D9B)content(-)char(\\u1DBF)char(\\u1E00)content(-)char(\\u1E9B)char(\\u1EA0)content(-)char(\\u1EF9)char(\\u1F00)content(-)char(\\u1F15)char(\\u1F18)content(-)char(\\u1F1D)char(\\u1F20)content(-)char(\\u1F45)char(\\u1F48)content(-)char(\\u1F4D)char(\\u1F50)content(-)char(\\u1F57)char(\\u1F59)char(\\u1F5B)char(\\u1F5D)char(\\u1F5F)content(-)char(\\u1F7D)char(\\u1F80)content(-)char(\\u1FB4)char(\\u1FB6)content(-)char(\\u1FBC)char(\\u1FBE)char(\\u1FC2)content(-)char(\\u1FC4)char(\\u1FC6)content(-)char(\\u1FCC)char(\\u1FD0)content(-)char(\\u1FD3)char(\\u1FD6)content(-)char(\\u1FDB)char(\\u1FE0)content(-)char(\\u1FEC)char(\\u1FF2)content(-)char(\\u1FF4)char(\\u1FF6)content(-)char(\\u1FFC)char(\\u2071)char(\\u207F)char(\\u2090)content(-)char(\\u2094)char(\\u2102)char(\\u2107)char(\\u210A)content(-)char(\\u2113)char(\\u2115)char(\\u2118)char(\\u2119)content(-)char(\\u211D)char(\\u2124)char(\\u2126)char(\\u2128)char(\\u212A)content(-)char(\\u212D)char(\\u212E)char(\\u212F)content(-)char(\\u2131)char(\\u2133)content(-)char(\\u2134)char(\\u2135)content(-)char(\\u2138)char(\\u2139)char(\\u213C)content(-)char(\\u213F)char(\\u2145)content(-)char(\\u2149)char(\\u2160)content(-)char(\\u2183)char(\\u2C00)content(-)char(\\u2C2E)char(\\u2C30)content(-)char(\\u2C5E)char(\\u2C80)content(-)char(\\u2CE4)char(\\u2D00)content(-)char(\\u2D25)char(\\u2D30)content(-)char(\\u2D65)char(\\u2D6F)char(\\u2D80)content(-)char(\\u2D96)char(\\u2DA0)content(-)char(\\u2DA6)char(\\u2DA8)content(-)char(\\u2DAE)char(\\u2DB0)content(-)char(\\u2DB6)char(\\u2DB8)content(-)char(\\u2DBE)char(\\u2DC0)content(-)char(\\u2DC6)char(\\u2DC8)content(-)char(\\u2DCE)char(\\u2DD0)content(-)char(\\u2DD6)char(\\u2DD8)content(-)char(\\u2DDE)char(\\u3005)char(\\u3006)char(\\u3007)char(\\u3021)content(-)char(\\u3029)char(\\u3031)content(-)char(\\u3035)char(\\u3038)content(-)char(\\u303A)char(\\u303B)char(\\u303C)char(\\u3041)content(-)char(\\u3096)char(\\u309D)content(-)char(\\u309E)char(\\u309F)char(\\u30A1)content(-)char(\\u30FA)char(\\u30FC)content(-)char(\\u30FE)char(\\u30FF)char(\\u3105)content(-)char(\\u312C)char(\\u3131)content(-)char(\\u318E)char(\\u31A0)content(-)char(\\u31B7)char(\\u31F0)content(-)char(\\u31FF)char(\\u3400)content(-)char(\\u4DB5)char(\\u4E00)content(-)char(\\u9FBB)char(\\uA000)content(-)char(\\uA014)char(\\uA015)char(\\uA016)content(-)char(\\uA48C)char(\\uA800)content(-)char(\\uA801)char(\\uA803)content(-)char(\\uA805)char(\\uA807)content(-)char(\\uA80A)char(\\uA80C)content(-)char(\\uA822)char(\\uAC00)content(-)char(\\uD7A3)char(\\uF900)content(-)char(\\uFA2D)char(\\uFA30)content(-)char(\\uFA6A)char(\\uFA70)content(-)char(\\uFAD9)char(\\uFB00)content(-)char(\\uFB06)char(\\uFB13)content(-)char(\\uFB17)char(\\uFB1D)char(\\uFB1F)content(-)char(\\uFB28)char(\\uFB2A)content(-)char(\\uFB36)char(\\uFB38)content(-)char(\\uFB3C)char(\\uFB3E)char(\\uFB40)content(-)char(\\uFB41)char(\\uFB43)content(-)char(\\uFB44)char(\\uFB46)content(-)char(\\uFBB1)char(\\uFBD3)content(-)char(\\uFC5D)char(\\uFC64)content(-)char(\\uFD3D)char(\\uFD50)content(-)char(\\uFD8F)char(\\uFD92)content(-)char(\\uFDC7)char(\\uFDF0)content(-)char(\\uFDF9)char(\\uFE71)char(\\uFE73)char(\\uFE77)char(\\uFE79)char(\\uFE7B)char(\\uFE7D)char(\\uFE7F)content(-)char(\\uFEFC)char(\\uFF21)content(-)char(\\uFF3A)char(\\uFF41)content(-)char(\\uFF5A)char(\\uFF66)content(-)char(\\uFF6F)char(\\uFF70)char(\\uFF71)content(-)char(\\uFF9D)char(\\uFFA0)content(-)char(\\uFFBE)char(\\uFFC2)content(-)char(\\uFFC7)char(\\uFFCA)content(-)char(\\uFFCF)char(\\uFFD2)content(-)char(\\uFFD7)char(\\uFFDA)content(-)char(\\uFFDC)delimiter(')> ident(xid_continue) operator(=) string<modifier(u)delimiter(')char(\\u0030)content(-)char(\\u0039)char(\\u0041)content(-)char(\\u005A)char(\\u005F)char(\\u0061)content(-)char(\\u007A)char(\\u00AA)char(\\u00B5)char(\\u00B7)char(\\u00BA)char(\\u00C0)content(-)char(\\u00D6)char(\\u00D8)content(-)char(\\u00F6)char(\\u00F8)content(-)char(\\u01BA)char(\\u01BB)char(\\u01BC)content(-)char(\\u01BF)char(\\u01C0)content(-)char(\\u01C3)char(\\u01C4)content(-)char(\\u0241)char(\\u0250)content(-)char(\\u02AF)char(\\u02B0)content(-)char(\\u02C1)char(\\u02C6)content(-)char(\\u02D1)char(\\u02E0)content(-)char(\\u02E4)char(\\u02EE)char(\\u0300)content(-)char(\\u036F)char(\\u0386)char(\\u0388)content(-)char(\\u038A)char(\\u038C)char(\\u038E)content(-)char(\\u03A1)char(\\u03A3)content(-)char(\\u03CE)char(\\u03D0)content(-)char(\\u03F5)char(\\u03F7)content(-)char(\\u0481)char(\\u0483)content(-)char(\\u0486)char(\\u048A)content(-)char(\\u04CE)char(\\u04D0)content(-)char(\\u04F9)char(\\u0500)content(-)char(\\u050F)char(\\u0531)content(-)char(\\u0556)char(\\u0559)char(\\u0561)content(-)char(\\u0587)char(\\u0591)content(-)char(\\u05B9)char(\\u05BB)content(-)char(\\u05BD)char(\\u05BF)char(\\u05C1)content(-)char(\\u05C2)char(\\u05C4)content(-)char(\\u05C5)char(\\u05C7)char(\\u05D0)content(-)char(\\u05EA)char(\\u05F0)content(-)char(\\u05F2)char(\\u0610)content(-)char(\\u0615)char(\\u0621)content(-)char(\\u063A)char(\\u0640)char(\\u0641)content(-)char(\\u064A)char(\\u064B)content(-)char(\\u065E)char(\\u0660)content(-)char(\\u0669)char(\\u066E)content(-)char(\\u066F)char(\\u0670)char(\\u0671)content(-)char(\\u06D3)char(\\u06D5)char(\\u06D6)content(-)char(\\u06DC)char(\\u06DF)content(-)char(\\u06E4)char(\\u06E5)content(-)char(\\u06E6)char(\\u06E7)content(-)char(\\u06E8)char(\\u06EA)content(-)char(\\u06ED)char(\\u06EE)content(-)char(\\u06EF)char(\\u06F0)content(-)char(\\u06F9)char(\\u06FA)content(-)char(\\u06FC)char(\\u06FF)char(\\u0710)char(\\u0711)char(\\u0712)content(-)char(\\u072F)char(\\u0730)content(-)char(\\u074A)char(\\u074D)content(-)char(\\u076D)char(\\u0780)content(-)char(\\u07A5)char(\\u07A6)content(-)char(\\u07B0)char(\\u07B1)char(\\u0901)content(-)char(\\u0902)char(\\u0903)char(\\u0904)content(-)char(\\u0939)char(\\u093C)char(\\u093D)char(\\u093E)content(-)char(\\u0940)char(\\u0941)content(-)char(\\u0948)char(\\u0949)content(-)char(\\u094C)char(\\u094D)char(\\u0950)char(\\u0951)content(-)char(\\u0954)char(\\u0958)content(-)char(\\u0961)char(\\u0962)content(-)char(\\u0963)char(\\u0966)content(-)char(\\u096F)char(\\u097D)char(\\u0981)char(\\u0982)content(-)char(\\u0983)char(\\u0985)content(-)char(\\u098C)char(\\u098F)content(-)char(\\u0990)char(\\u0993)content(-)char(\\u09A8)char(\\u09AA)content(-)char(\\u09B0)char(\\u09B2)char(\\u09B6)content(-)char(\\u09B9)char(\\u09BC)char(\\u09BD)char(\\u09BE)content(-)char(\\u09C0)char(\\u09C1)content(-)char(\\u09C4)char(\\u09C7)content(-)char(\\u09C8)char(\\u09CB)content(-)char(\\u09CC)char(\\u09CD)char(\\u09CE)char(\\u09D7)char(\\u09DC)content(-)char(\\u09DD)char(\\u09DF)content(-)char(\\u09E1)char(\\u09E2)content(-)char(\\u09E3)char(\\u09E6)content(-)char(\\u09EF)char(\\u09F0)content(-)char(\\u09F1)char(\\u0A01)content(-)char(\\u0A02)char(\\u0A03)char(\\u0A05)content(-)char(\\u0A0A)char(\\u0A0F)content(-)char(\\u0A10)char(\\u0A13)content(-)char(\\u0A28)char(\\u0A2A)content(-)char(\\u0A30)char(\\u0A32)content(-)char(\\u0A33)char(\\u0A35)content(-)char(\\u0A36)char(\\u0A38)content(-)char(\\u0A39)char(\\u0A3C)char(\\u0A3E)content(-)char(\\u0A40)char(\\u0A41)content(-)char(\\u0A42)char(\\u0A47)content(-)char(\\u0A48)char(\\u0A4B)content(-)char(\\u0A4D)char(\\u0A59)content(-)char(\\u0A5C)char(\\u0A5E)char(\\u0A66)content(-)char(\\u0A6F)char(\\u0A70)content(-)char(\\u0A71)char(\\u0A72)content(-)char(\\u0A74)char(\\u0A81)content(-)char(\\u0A82)char(\\u0A83)char(\\u0A85)content(-)char(\\u0A8D)char(\\u0A8F)content(-)char(\\u0A91)char(\\u0A93)content(-)char(\\u0AA8)char(\\u0AAA)content(-)char(\\u0AB0)char(\\u0AB2)content(-)char(\\u0AB3)char(\\u0AB5)content(-)char(\\u0AB9)char(\\u0ABC)char(\\u0ABD)char(\\u0ABE)content(-)char(\\u0AC0)char(\\u0AC1)content(-)char(\\u0AC5)char(\\u0AC7)content(-)char(\\u0AC8)char(\\u0AC9)char(\\u0ACB)content(-)char(\\u0ACC)char(\\u0ACD)char(\\u0AD0)char(\\u0AE0)content(-)char(\\u0AE1)char(\\u0AE2)content(-)char(\\u0AE3)char(\\u0AE6)content(-)char(\\u0AEF)char(\\u0B01)char(\\u0B02)content(-)char(\\u0B03)char(\\u0B05)content(-)char(\\u0B0C)char(\\u0B0F)content(-)char(\\u0B10)char(\\u0B13)content(-)char(\\u0B28)char(\\u0B2A)content(-)char(\\u0B30)char(\\u0B32)content(-)char(\\u0B33)char(\\u0B35)content(-)char(\\u0B39)char(\\u0B3C)char(\\u0B3D)char(\\u0B3E)char(\\u0B3F)char(\\u0B40)char(\\u0B41)content(-)char(\\u0B43)char(\\u0B47)content(-)char(\\u0B48)char(\\u0B4B)content(-)char(\\u0B4C)char(\\u0B4D)char(\\u0B56)char(\\u0B57)char(\\u0B5C)content(-)char(\\u0B5D)char(\\u0B5F)content(-)char(\\u0B61)char(\\u0B66)content(-)char(\\u0B6F)char(\\u0B71)char(\\u0B82)char(\\u0B83)char(\\u0B85)content(-)char(\\u0B8A)char(\\u0B8E)content(-)char(\\u0B90)char(\\u0B92)content(-)char(\\u0B95)char(\\u0B99)content(-)char(\\u0B9A)char(\\u0B9C)char(\\u0B9E)content(-)char(\\u0B9F)char(\\u0BA3)content(-)char(\\u0BA4)char(\\u0BA8)content(-)char(\\u0BAA)char(\\u0BAE)content(-)char(\\u0BB9)char(\\u0BBE)content(-)char(\\u0BBF)char(\\u0BC0)char(\\u0BC1)content(-)char(\\u0BC2)char(\\u0BC6)content(-)char(\\u0BC8)char(\\u0BCA)content(-)char(\\u0BCC)char(\\u0BCD)char(\\u0BD7)char(\\u0BE6)content(-)char(\\u0BEF)char(\\u0C01)content(-)char(\\u0C03)char(\\u0C05)content(-)char(\\u0C0C)char(\\u0C0E)content(-)char(\\u0C10)char(\\u0C12)content(-)char(\\u0C28)char(\\u0C2A)content(-)char(\\u0C33)char(\\u0C35)content(-)char(\\u0C39)char(\\u0C3E)content(-)char(\\u0C40)char(\\u0C41)content(-)char(\\u0C44)char(\\u0C46)content(-)char(\\u0C48)char(\\u0C4A)content(-)char(\\u0C4D)char(\\u0C55)content(-)char(\\u0C56)char(\\u0C60)content(-)char(\\u0C61)char(\\u0C66)content(-)char(\\u0C6F)char(\\u0C82)content(-)char(\\u0C83)char(\\u0C85)content(-)char(\\u0C8C)char(\\u0C8E)content(-)char(\\u0C90)char(\\u0C92)content(-)char(\\u0CA8)char(\\u0CAA)content(-)char(\\u0CB3)char(\\u0CB5)content(-)char(\\u0CB9)char(\\u0CBC)char(\\u0CBD)char(\\u0CBE)char(\\u0CBF)char(\\u0CC0)content(-)char(\\u0CC4)char(\\u0CC6)char(\\u0CC7)content(-)char(\\u0CC8)char(\\u0CCA)content(-)char(\\u0CCB)char(\\u0CCC)content(-)char(\\u0CCD)char(\\u0CD5)content(-)char(\\u0CD6)char(\\u0CDE)char(\\u0CE0)content(-)char(\\u0CE1)char(\\u0CE6)content(-)char(\\u0CEF)char(\\u0D02)content(-)char(\\u0D03)char(\\u0D05)content(-)char(\\u0D0C)char(\\u0D0E)content(-)char(\\u0D10)char(\\u0D12)content(-)char(\\u0D28)char(\\u0D2A)content(-)char(\\u0D39)char(\\u0D3E)content(-)char(\\u0D40)char(\\u0D41)content(-)char(\\u0D43)char(\\u0D46)content(-)char(\\u0D48)char(\\u0D4A)content(-)char(\\u0D4C)char(\\u0D4D)char(\\u0D57)char(\\u0D60)content(-)char(\\u0D61)char(\\u0D66)content(-)char(\\u0D6F)char(\\u0D82)content(-)char(\\u0D83)char(\\u0D85)content(-)char(\\u0D96)char(\\u0D9A)content(-)char(\\u0DB1)char(\\u0DB3)content(-)char(\\u0DBB)char(\\u0DBD)char(\\u0DC0)content(-)char(\\u0DC6)char(\\u0DCA)char(\\u0DCF)content(-)char(\\u0DD1)char(\\u0DD2)content(-)char(\\u0DD4)char(\\u0DD6)char(\\u0DD8)content(-)char(\\u0DDF)char(\\u0DF2)content(-)char(\\u0DF3)char(\\u0E01)content(-)char(\\u0E30)char(\\u0E31)char(\\u0E32)content(-)char(\\u0E33)char(\\u0E34)content(-)char(\\u0E3A)char(\\u0E40)content(-)char(\\u0E45)char(\\u0E46)char(\\u0E47)content(-)char(\\u0E4E)char(\\u0E50)content(-)char(\\u0E59)char(\\u0E81)content(-)char(\\u0E82)char(\\u0E84)char(\\u0E87)content(-)char(\\u0E88)char(\\u0E8A)char(\\u0E8D)char(\\u0E94)content(-)char(\\u0E97)char(\\u0E99)content(-)char(\\u0E9F)char(\\u0EA1)content(-)char(\\u0EA3)char(\\u0EA5)char(\\u0EA7)char(\\u0EAA)content(-)char(\\u0EAB)char(\\u0EAD)content(-)char(\\u0EB0)char(\\u0EB1)char(\\u0EB2)content(-)char(\\u0EB3)char(\\u0EB4)content(-)char(\\u0EB9)char(\\u0EBB)content(-)char(\\u0EBC)char(\\u0EBD)char(\\u0EC0)content(-)char(\\u0EC4)char(\\u0EC6)char(\\u0EC8)content(-)char(\\u0ECD)char(\\u0ED0)content(-)char(\\u0ED9)char(\\u0EDC)content(-)char(\\u0EDD)char(\\u0F00)char(\\u0F18)content(-)char(\\u0F19)char(\\u0F20)content(-)char(\\u0F29)char(\\u0F35)char(\\u0F37)char(\\u0F39)char(\\u0F3E)content(-)char(\\u0F3F)char(\\u0F40)content(-)char(\\u0F47)char(\\u0F49)content(-)char(\\u0F6A)char(\\u0F71)content(-)char(\\u0F7E)char(\\u0F7F)char(\\u0F80)content(-)char(\\u0F84)char(\\u0F86)content(-)char(\\u0F87)char(\\u0F88)content(-)char(\\u0F8B)char(\\u0F90)content(-)char(\\u0F97)char(\\u0F99)content(-)char(\\u0FBC)char(\\u0FC6)char(\\u1000)content(-)char(\\u1021)char(\\u1023)content(-)char(\\u1027)char(\\u1029)content(-)char(\\u102A)char(\\u102C)char(\\u102D)content(-)char(\\u1030)char(\\u1031)char(\\u1032)char(\\u1036)content(-)char(\\u1037)char(\\u1038)char(\\u1039)char(\\u1040)content(-)char(\\u1049)char(\\u1050)content(-)char(\\u1055)char(\\u1056)content(-)char(\\u1057)char(\\u1058)content(-)char(\\u1059)char(\\u10A0)content(-)char(\\u10C5)char(\\u10D0)content(-)char(\\u10FA)char(\\u10FC)char(\\u1100)content(-)char(\\u1159)char(\\u115F)content(-)char(\\u11A2)char(\\u11A8)content(-)char(\\u11F9)char(\\u1200)content(-)char(\\u1248)char(\\u124A)content(-)char(\\u124D)char(\\u1250)content(-)char(\\u1256)char(\\u1258)char(\\u125A)content(-)char(\\u125D)char(\\u1260)content(-)char(\\u1288)char(\\u128A)content(-)char(\\u128D)char(\\u1290)content(-)char(\\u12B0)char(\\u12B2)content(-)char(\\u12B5)char(\\u12B8)content(-)char(\\u12BE)char(\\u12C0)char(\\u12C2)content(-)char(\\u12C5)char(\\u12C8)content(-)char(\\u12D6)char(\\u12D8)content(-)char(\\u1310)char(\\u1312)content(-)char(\\u1315)char(\\u1318)content(-)char(\\u135A)char(\\u135F)char(\\u1369)content(-)char(\\u1371)char(\\u1380)content(-)char(\\u138F)char(\\u13A0)content(-)char(\\u13F4)char(\\u1401)content(-)char(\\u166C)char(\\u166F)content(-)char(\\u1676)char(\\u1681)content(-)char(\\u169A)char(\\u16A0)content(-)char(\\u16EA)char(\\u16EE)content(-)char(\\u16F0)char(\\u1700)content(-)char(\\u170C)char(\\u170E)content(-)char(\\u1711)char(\\u1712)content(-)char(\\u1714)char(\\u1720)content(-)char(\\u1731)char(\\u1732)content(-)char(\\u1734)char(\\u1740)content(-)char(\\u1751)char(\\u1752)content(-)char(\\u1753)char(\\u1760)content(-)char(\\u176C)char(\\u176E)content(-)char(\\u1770)char(\\u1772)content(-)char(\\u1773)char(\\u1780)content(-)char(\\u17B3)char(\\u17B6)char(\\u17B7)content(-)char(\\u17BD)char(\\u17BE)content(-)char(\\u17C5)char(\\u17C6)char(\\u17C7)content(-)char(\\u17C8)char(\\u17C9)content(-)char(\\u17D3)char(\\u17D7)char(\\u17DC)char(\\u17DD)char(\\u17E0)content(-)char(\\u17E9)char(\\u180B)content(-)char(\\u180D)char(\\u1810)content(-)char(\\u1819)char(\\u1820)content(-)char(\\u1842)char(\\u1843)char(\\u1844)content(-)char(\\u1877)char(\\u1880)content(-)char(\\u18A8)char(\\u18A9)char(\\u1900)content(-)char(\\u191C)char(\\u1920)content(-)char(\\u1922)char(\\u1923)content(-)char(\\u1926)char(\\u1927)content(-)char(\\u1928)char(\\u1929)content(-)char(\\u192B)char(\\u1930)content(-)char(\\u1931)char(\\u1932)char(\\u1933)content(-)char(\\u1938)char(\\u1939)content(-)char(\\u193B)char(\\u1946)content(-)char(\\u194F)char(\\u1950)content(-)char(\\u196D)char(\\u1970)content(-)char(\\u1974)char(\\u1980)content(-)char(\\u19A9)char(\\u19B0)content(-)char(\\u19C0)char(\\u19C1)content(-)char(\\u19C7)char(\\u19C8)content(-)char(\\u19C9)char(\\u19D0)content(-)char(\\u19D9)char(\\u1A00)content(-)char(\\u1A16)char(\\u1A17)content(-)char(\\u1A18)char(\\u1A19)content(-)char(\\u1A1B)char(\\u1D00)content(-)char(\\u1D2B)char(\\u1D2C)content(-)char(\\u1D61)char(\\u1D62)content(-)char(\\u1D77)char(\\u1D78)char(\\u1D79)content(-)char(\\u1D9A)char(\\u1D9B)content(-)char(\\u1DBF)char(\\u1DC0)content(-)char(\\u1DC3)char(\\u1E00)content(-)char(\\u1E9B)char(\\u1EA0)content(-)char(\\u1EF9)char(\\u1F00)content(-)char(\\u1F15)char(\\u1F18)content(-)char(\\u1F1D)char(\\u1F20)content(-)char(\\u1F45)char(\\u1F48)content(-)char(\\u1F4D)char(\\u1F50)content(-)char(\\u1F57)char(\\u1F59)char(\\u1F5B)char(\\u1F5D)char(\\u1F5F)content(-)char(\\u1F7D)char(\\u1F80)content(-)char(\\u1FB4)char(\\u1FB6)content(-)char(\\u1FBC)char(\\u1FBE)char(\\u1FC2)content(-)char(\\u1FC4)char(\\u1FC6)content(-)char(\\u1FCC)char(\\u1FD0)content(-)char(\\u1FD3)char(\\u1FD6)content(-)char(\\u1FDB)char(\\u1FE0)content(-)char(\\u1FEC)char(\\u1FF2)content(-)char(\\u1FF4)char(\\u1FF6)content(-)char(\\u1FFC)char(\\u203F)content(-)char(\\u2040)char(\\u2054)char(\\u2071)char(\\u207F)char(\\u2090)content(-)char(\\u2094)char(\\u20D0)content(-)char(\\u20DC)char(\\u20E1)char(\\u20E5)content(-)char(\\u20EB)char(\\u2102)char(\\u2107)char(\\u210A)content(-)char(\\u2113)char(\\u2115)char(\\u2118)char(\\u2119)content(-)char(\\u211D)char(\\u2124)char(\\u2126)char(\\u2128)char(\\u212A)content(-)char(\\u212D)char(\\u212E)char(\\u212F)content(-)char(\\u2131)char(\\u2133)content(-)char(\\u2134)char(\\u2135)content(-)char(\\u2138)char(\\u2139)char(\\u213C)content(-)char(\\u213F)char(\\u2145)content(-)char(\\u2149)char(\\u2160)content(-)char(\\u2183)char(\\u2C00)content(-)char(\\u2C2E)char(\\u2C30)content(-)char(\\u2C5E)char(\\u2C80)content(-)char(\\u2CE4)char(\\u2D00)content(-)char(\\u2D25)char(\\u2D30)content(-)char(\\u2D65)char(\\u2D6F)char(\\u2D80)content(-)char(\\u2D96)char(\\u2DA0)content(-)char(\\u2DA6)char(\\u2DA8)content(-)char(\\u2DAE)char(\\u2DB0)content(-)char(\\u2DB6)char(\\u2DB8)content(-)char(\\u2DBE)char(\\u2DC0)content(-)char(\\u2DC6)char(\\u2DC8)content(-)char(\\u2DCE)char(\\u2DD0)content(-)char(\\u2DD6)char(\\u2DD8)content(-)char(\\u2DDE)char(\\u3005)char(\\u3006)char(\\u3007)char(\\u3021)content(-)char(\\u3029)char(\\u302A)content(-)char(\\u302F)char(\\u3031)content(-)char(\\u3035)char(\\u3038)content(-)char(\\u303A)char(\\u303B)char(\\u303C)char(\\u3041)content(-)char(\\u3096)char(\\u3099)content(-)char(\\u309A)char(\\u309D)content(-)char(\\u309E)char(\\u309F)char(\\u30A1)content(-)char(\\u30FA)char(\\u30FC)content(-)char(\\u30FE)char(\\u30FF)char(\\u3105)content(-)char(\\u312C)char(\\u3131)content(-)char(\\u318E)char(\\u31A0)content(-)char(\\u31B7)char(\\u31F0)content(-)char(\\u31FF)char(\\u3400)content(-)char(\\u4DB5)char(\\u4E00)content(-)char(\\u9FBB)char(\\uA000)content(-)char(\\uA014)char(\\uA015)char(\\uA016)content(-)char(\\uA48C)char(\\uA800)content(-)char(\\uA801)char(\\uA802)char(\\uA803)content(-)char(\\uA805)char(\\uA806)char(\\uA807)content(-)char(\\uA80A)char(\\uA80B)char(\\uA80C)content(-)char(\\uA822)char(\\uA823)content(-)char(\\uA824)char(\\uA825)content(-)char(\\uA826)char(\\uA827)char(\\uAC00)content(-)char(\\uD7A3)char(\\uF900)content(-)char(\\uFA2D)char(\\uFA30)content(-)char(\\uFA6A)char(\\uFA70)content(-)char(\\uFAD9)char(\\uFB00)content(-)char(\\uFB06)char(\\uFB13)content(-)char(\\uFB17)char(\\uFB1D)char(\\uFB1E)char(\\uFB1F)content(-)char(\\uFB28)char(\\uFB2A)content(-)char(\\uFB36)char(\\uFB38)content(-)char(\\uFB3C)char(\\uFB3E)char(\\uFB40)content(-)char(\\uFB41)char(\\uFB43)content(-)char(\\uFB44)char(\\uFB46)content(-)char(\\uFBB1)char(\\uFBD3)content(-)char(\\uFC5D)char(\\uFC64)content(-)char(\\uFD3D)char(\\uFD50)content(-)char(\\uFD8F)char(\\uFD92)content(-)char(\\uFDC7)char(\\uFDF0)content(-)char(\\uFDF9)char(\\uFE00)content(-)char(\\uFE0F)char(\\uFE20)content(-)char(\\uFE23)char(\\uFE33)content(-)char(\\uFE34)char(\\uFE4D)content(-)char(\\uFE4F)char(\\uFE71)char(\\uFE73)char(\\uFE77)char(\\uFE79)char(\\uFE7B)char(\\uFE7D)char(\\uFE7F)content(-)char(\\uFEFC)char(\\uFF10)content(-)char(\\uFF19)char(\\uFF21)content(-)char(\\uFF3A)char(\\uFF3F)char(\\uFF41)content(-)char(\\uFF5A)char(\\uFF66)content(-)char(\\uFF6F)char(\\uFF70)char(\\uFF71)content(-)char(\\uFF9D)char(\\uFF9E)content(-)char(\\uFF9F)char(\\uFFA0)content(-)char(\\uFFBE)char(\\uFFC2)content(-)char(\\uFFC7)char(\\uFFCA)content(-)char(\\uFFCF)char(\\uFFD2)content(-)char(\\uFFD7)char(\\uFFDA)content(-)char(\\uFFDC)delimiter(')> -keyword(def) ident(allexcept)operator(()operator(*)ident(args)operator(\))operator(:) +keyword(def) method(allexcept)operator(()operator(*)ident(args)operator(\))operator(:) ident(newcats) operator(=) ident(cats)operator([)operator(:)operator(]) keyword(for) ident(arg) keyword(in) ident(args)operator(:) ident(newcats)operator(.)ident(remove)operator(()ident(arg)operator(\)) |