diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index f80a476..0000000 --- a/TODO.txt +++ /dev/null @@ -1,22 +0,0 @@ -Now -=== - -- Add support for slice syntax: - http://img155.imageshack.us/img155/7767/screenshotgs.png - -- When we check spelling we don't need to check the whole strings only the - content. For example we don't need to check 'u' for spelling in strings - like this: u"Some text"; - -Later -===== - -- Need more accurate way to handle indentation errors. For example - mixing spaces and tabs may be used for pretty formatting; - -- Need more checks for errors like: absent brackets, absent quotes, - back slash at the end of strings; - -- pythonError tips from - http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/ (reported by - Giuliani Deon Sanches) diff --git a/folding-ideas/python.vim.1.13 b/folding-ideas/python.vim.1.13 deleted file mode 100644 index e5ea668..0000000 --- a/folding-ideas/python.vim.1.13 +++ /dev/null @@ -1,237 +0,0 @@ -" Vim syntax file -" Language: Python -" Maintainer: Neil Schemenauer -" Updated: $Date: 2003/01/12 14:17:34 $ -" Updated by: Dmitry Vasiliev -" Filenames: *.py -" $Revision: 1.13 $ -" -" Options: -" For folded functions and classes: -" -" let python_folding = 1 -" -" For highlighted builtin functions: -" -" let python_highlight_builtins = 1 -" -" For highlighted standard exceptions: -" -" let python_highlight_exceptions = 1 -" -" For highlighted string formatting: -" -" let python_highlight_string_formatting = 1 -" -" If you want all possible Python highlighting: -" -" let python_highlight_all = 1 -" -" TODO: Check more errors? - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -if exists("python_highlight_all") - let python_folding = 1 - let python_highlight_builtins = 1 - let python_highlight_exceptions = 1 - let python_highlight_string_formatting = 1 -endif - -" Keywords -syn keyword pythonStatement break continue del -syn keyword pythonStatement exec return -syn keyword pythonStatement pass print raise -syn keyword pythonStatement global assert -syn keyword pythonStatement lambda yield -if exists("python_folding") && has("folding") - syn match pythonStatement "\<\(def\|class\)\>" display nextgroup=pythonFunction skipwhite -else - syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite -endif -syn match pythonFunction "\h\w*" display contained -syn keyword pythonRepeat for while -syn keyword pythonConditional if elif else -syn keyword pythonImport import from as -syn keyword pythonException try except finally -syn keyword pythonOperator and in is not or - -" Comments -syn match pythonComment "#.*$" display contains=pythonTodo -syn keyword pythonTodo TODO FIXME XXX contained - -" Erroneous characters that cannont be in a python program -syn match pythonError "[@$?]" display -" Mixing spaces and tabs is bad -syn match pythonIndentError "^\s*\(\t \| \t\)\s*" display - -" Strings -syn region pythonString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonEscape,pythonEscapeError -syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonEscape,pythonEscapeError -syn region pythonString start=+"""+ end=+"""+ contains=pythonEscape,pythonEscapeError -syn region pythonString start=+'''+ end=+'''+ contains=pythonEscape,pythonEscapeError - -syn match pythonEscape +\\[abfnrtv'"\\]+ display contained -syn match pythonEscapeError +\\[^abfnrtv'"\\]+ display contained -syn match pythonEscape "\\\o\o\=\o\=" display contained -syn match pythonEscapeError "\\\o\{,2}[89]" display contained -syn match pythonEscape "\\x\x\{2}" display contained -syn match pythonEscapeError "\\x\x\=\X" display contained -syn match pythonEscape "\\$" - -" Unicode strings -syn region pythonUniString start=+[uU]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError -syn region pythonUniString start=+[uU]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError -syn region pythonUniString start=+[uU]"""+ end=+"""+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError -syn region pythonUniString start=+[uU]'''+ end=+'''+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError - -syn match pythonUniEscape "\\u\x\{4}" display contained -syn match pythonUniEscapeError "\\u\x\{,3}\X" display contained -syn match pythonUniEscape "\\U\x\{8}" display contained -syn match pythonUniEscapeError "\\U\x\{,7}\X" display contained -syn match pythonUniEscape "\\N{[A-Z ]\+}" display contained -syn match pythonUniEscapeError "\\N{[^A-Z ]\+}" display contained - -" Raw strings -syn region pythonRawString start=+[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonRawEscape -syn region pythonRawString start=+[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonRawEscape -syn region pythonRawString start=+[rR]"""+ end=+"""+ -syn region pythonRawString start=+[rR]'''+ end=+'''+ - -syn match pythonRawEscape +\\['"]+ display transparent contained - -" Unicode raw strings -syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError -syn region pythonUniRawString start=+[uU][rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError -syn region pythonUniRawString start=+[uU][rR]"""+ end=+"""+ contains=pythonUniRawEscape,pythonUniRawEscapeError -syn region pythonUniRawString start=+[uU][rR]'''+ end=+'''+ contains=pythonUniRawEscape,pythonUniRawEscapeError - -syn match pythonUniRawEscape "\([^\\]\(\\\\\)*\)\@<=\\u\x\{4}" display contained -syn match pythonUniRawEscapeError "\([^\\]\(\\\\\)*\)\@<=\\u\x\{,3}\X" display contained - -if exists("python_highlight_string_formatting") - " String formatting - syn match pythonStrFormat "%\(([^)]\+)\)\=[-#0 +]\=\d*\(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString - syn match pythonStrFormat "%[-#0 +]\=\(\*\|\d\+\)\=\(\.\(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString -endif - -" Numbers (ints, longs, floats, complex) -syn match pythonNumber "\<0[xX]\x\+[lL]\=\>" display -syn match pythonNumber "\<\d\+[lLjJ]\=\>" display -syn match pythonFloat "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" display -syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display -syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display -syn match pythonOctalError "\<0\o*[89]\d*[lLjJ]\=\>" display - -if exists("python_highlight_builtins") - " Builtin functions, types and objects, not really part of the syntax - syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented - syn keyword pythonBuiltinFunc bool __import__ abs - syn keyword pythonBuiltinFunc apply buffer callable chr classmethod cmp - syn keyword pythonBuiltinFunc coerce compile complex delattr dict dir divmod - syn keyword pythonBuiltinFunc eval execfile file filter float getattr globals - syn keyword pythonBuiltinFunc hasattr hash hex id input int intern isinstance - syn keyword pythonBuiltinFunc issubclass iter len list locals long map max - syn keyword pythonBuiltinFunc min object oct open ord pow property range - syn keyword pythonBuiltinFunc raw_input reduce reload repr round setattr - syn keyword pythonBuiltinFunc slice staticmethod str super tuple type unichr - syn keyword pythonBuiltinFunc unicode vars xrange zip -endif - -if exists("python_highlight_exceptions") - " Builtin exceptions and warnings - syn keyword pythonExClass ArithmeticError AssertionError AttributeError - syn keyword pythonExClass DeprecationWarning EOFError EnvironmentError - syn keyword pythonExClass Exception FloatingPointError IOError - syn keyword pythonExClass ImportError IndentiationError IndexError - syn keyword pythonExClass KeyError KeyboardInterrupt LookupError - syn keyword pythonExClass MemoryError NameError NotImplementedError - syn keyword pythonExClass OSError OverflowError OverflowWarning - syn keyword pythonExClass ReferenceError RuntimeError RuntimeWarning - syn keyword pythonExClass StandardError StopIteration SyntaxError - syn keyword pythonExClass SyntaxWarning SystemError SystemExit TabError - syn keyword pythonExClass TypeError UnboundLocalError UnicodeError - syn keyword pythonExClass UserWarning ValueError Warning WindowsError - syn keyword pythonExClass ZeroDivisionError -endif - -syn sync clear -if exists("python_folding") && has("folding") - syn sync fromstart - - "syn match pythonFold "^\(\s*\)\(class\|def\)\s.*\(\(\n\s*\)*\n\1\s\+\S.*\)\+" transparent fold - syn region pythonFold start="^\z(\s*\)\(class\|def\)\s" skip="^\z1\s\+\S" end="^\s*\S"me=s-1 transparent fold - syn region pythonFold start="{" end="}" transparent fold - syn region pythonFold start="\[" end="\]" transparent fold -else - " This is fast but code inside triple quoted strings screws it up. It - " is impossible to fix because the only way to know if you are inside a - " triple quoted string is to start from the beginning of the file. If - " you have a fast machine you can try uncommenting the "sync minlines" - " and commenting out the rest. - syn sync match pythonSync grouphere NONE "):$" - syn sync maxlines=200 - "syn sync minlines=2000 -endif - -if version >= 508 || !exists("did_python_syn_inits") - if version <= 508 - let did_python_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink pythonStatement Statement - HiLink pythonImport Statement - HiLink pythonFunction Function - HiLink pythonConditional Conditional - HiLink pythonRepeat Repeat - HiLink pythonException Exception - HiLink pythonOperator Operator - - HiLink pythonComment Comment - HiLink pythonTodo Todo - - HiLink pythonError Error - HiLink pythonIndentError Error - - HiLink pythonString String - HiLink pythonUniString String - HiLink pythonRawString String - HiLink pythonUniRawString String - - HiLink pythonEscape Special - HiLink pythonEscapeError Error - HiLink pythonUniEscape Special - HiLink pythonUniEscapeError Error - HiLink pythonUniRawEscape Special - HiLink pythonUniRawEscapeError Error - - if exists("python_highlight_string_formatting") - HiLink pythonStrFormat Special - endif - - HiLink pythonNumber Number - HiLink pythonFloat Float - HiLink pythonOctalError Error - - if exists("python_highlight_builtins") - HiLink pythonBuiltinObj Structure - HiLink pythonBuiltinFunc Function - endif - - if exists("python_highlight_exceptions") - HiLink pythonExClass Structure - endif - - delcommand HiLink -endif - -let b:current_syntax = "python" diff --git a/folding-ideas/python.vim.1.14 b/folding-ideas/python.vim.1.14 deleted file mode 100644 index 9027838..0000000 --- a/folding-ideas/python.vim.1.14 +++ /dev/null @@ -1,236 +0,0 @@ -" Vim syntax file -" Language: Python -" Maintainer: Neil Schemenauer -" Updated: $Date: 2003/01/12 15:35:02 $ -" Updated by: Dmitry Vasiliev -" Filenames: *.py -" $Revision: 1.14 $ -" -" Options: -" For folded functions and classes: -" -" let python_folding = 1 -" -" For highlighted builtin functions: -" -" let python_highlight_builtins = 1 -" -" For highlighted standard exceptions: -" -" let python_highlight_exceptions = 1 -" -" For highlighted string formatting: -" -" let python_highlight_string_formatting = 1 -" -" If you want all possible Python highlighting: -" -" let python_highlight_all = 1 -" -" TODO: Check more errors? - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -if exists("python_highlight_all") - let python_folding = 1 - let python_highlight_builtins = 1 - let python_highlight_exceptions = 1 - let python_highlight_string_formatting = 1 -endif - -" Keywords -syn keyword pythonStatement break continue del -syn keyword pythonStatement exec return -syn keyword pythonStatement pass print raise -syn keyword pythonStatement global assert -syn keyword pythonStatement lambda yield -if exists("python_folding") && has("folding") - syn match pythonStatement "\<\(def\|class\)\>" display nextgroup=pythonFunction skipwhite -else - syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite -endif -syn match pythonFunction "\h\w*" display contained -syn keyword pythonRepeat for while -syn keyword pythonConditional if elif else -syn keyword pythonImport import from as -syn keyword pythonException try except finally -syn keyword pythonOperator and in is not or - -" Comments -syn match pythonComment "#.*$" display contains=pythonTodo -syn keyword pythonTodo TODO FIXME XXX contained - -" Erroneous characters that cannont be in a python program -syn match pythonError "[@$?]" display -" Mixing spaces and tabs is bad -syn match pythonError "^\s*\(\t \| \t\)\s*" display - -" Strings -syn region pythonString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonEscape,pythonEscapeError -syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonEscape,pythonEscapeError -syn region pythonString start=+"""+ end=+"""+ contains=pythonEscape,pythonEscapeError -syn region pythonString start=+'''+ end=+'''+ contains=pythonEscape,pythonEscapeError - -syn match pythonEscape +\\[abfnrtv'"\\]+ display contained -syn match pythonEscapeError +\\[^abfnrtv'"\\]+ display contained -syn match pythonEscape "\\\o\o\=\o\=" display contained -syn match pythonEscapeError "\\\o\{,2}[89]" display contained -syn match pythonEscape "\\x\x\{2}" display contained -syn match pythonEscapeError "\\x\x\=\X" display contained -syn match pythonEscape "\\$" - -" Unicode strings -syn region pythonUniString start=+[uU]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError -syn region pythonUniString start=+[uU]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError -syn region pythonUniString start=+[uU]"""+ end=+"""+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError -syn region pythonUniString start=+[uU]'''+ end=+'''+ contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError - -syn match pythonUniEscape "\\u\x\{4}" display contained -syn match pythonUniEscapeError "\\u\x\{,3}\X" display contained -syn match pythonUniEscape "\\U\x\{8}" display contained -syn match pythonUniEscapeError "\\U\x\{,7}\X" display contained -syn match pythonUniEscape "\\N{[A-Z ]\+}" display contained -syn match pythonUniEscapeError "\\N{[^A-Z ]\+}" display contained - -" Raw strings -syn region pythonRawString start=+[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonRawEscape -syn region pythonRawString start=+[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonRawEscape -syn region pythonRawString start=+[rR]"""+ end=+"""+ -syn region pythonRawString start=+[rR]'''+ end=+'''+ - -syn match pythonRawEscape +\\['"]+ display transparent contained - -" Unicode raw strings -syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError -syn region pythonUniRawString start=+[uU][rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError -syn region pythonUniRawString start=+[uU][rR]"""+ end=+"""+ contains=pythonUniRawEscape,pythonUniRawEscapeError -syn region pythonUniRawString start=+[uU][rR]'''+ end=+'''+ contains=pythonUniRawEscape,pythonUniRawEscapeError - -syn match pythonUniRawEscape "\([^\\]\(\\\\\)*\)\@<=\\u\x\{4}" display contained -syn match pythonUniRawEscapeError "\([^\\]\(\\\\\)*\)\@<=\\u\x\{,3}\X" display contained - -if exists("python_highlight_string_formatting") - " String formatting - syn match pythonStrFormat "%\(([^)]\+)\)\=[-#0 +]\=\d*\(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString - syn match pythonStrFormat "%[-#0 +]\=\(\*\|\d\+\)\=\(\.\(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString -endif - -" Numbers (ints, longs, floats, complex) -syn match pythonNumber "\<0[xX]\x\+[lL]\=\>" display -syn match pythonNumber "\<\d\+[lLjJ]\=\>" display -syn match pythonFloat "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" display -syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display -syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display -syn match pythonOctalError "\<0\o*[89]\d*[lLjJ]\=\>" display - -if exists("python_highlight_builtins") - " Builtin functions, types and objects, not really part of the syntax - syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented - syn keyword pythonBuiltinFunc bool __import__ abs - syn keyword pythonBuiltinFunc apply buffer callable chr classmethod cmp - syn keyword pythonBuiltinFunc coerce compile complex delattr dict dir divmod - syn keyword pythonBuiltinFunc eval execfile file filter float getattr globals - syn keyword pythonBuiltinFunc hasattr hash hex id input int intern isinstance - syn keyword pythonBuiltinFunc issubclass iter len list locals long map max - syn keyword pythonBuiltinFunc min object oct open ord pow property range - syn keyword pythonBuiltinFunc raw_input reduce reload repr round setattr - syn keyword pythonBuiltinFunc slice staticmethod str super tuple type unichr - syn keyword pythonBuiltinFunc unicode vars xrange zip -endif - -if exists("python_highlight_exceptions") - " Builtin exceptions and warnings - syn keyword pythonExClass ArithmeticError AssertionError AttributeError - syn keyword pythonExClass DeprecationWarning EOFError EnvironmentError - syn keyword pythonExClass Exception FloatingPointError IOError - syn keyword pythonExClass ImportError IndentiationError IndexError - syn keyword pythonExClass KeyError KeyboardInterrupt LookupError - syn keyword pythonExClass MemoryError NameError NotImplementedError - syn keyword pythonExClass OSError OverflowError OverflowWarning - syn keyword pythonExClass ReferenceError RuntimeError RuntimeWarning - syn keyword pythonExClass StandardError StopIteration SyntaxError - syn keyword pythonExClass SyntaxWarning SystemError SystemExit TabError - syn keyword pythonExClass TypeError UnboundLocalError UnicodeError - syn keyword pythonExClass UserWarning ValueError Warning WindowsError - syn keyword pythonExClass ZeroDivisionError -endif - -syn sync clear -if exists("python_folding") && has("folding") - syn sync fromstart - - "syn match pythonFold "^\(\s*\)\(class\|def\)\s.*\(\(\n\s*\)*\n\1\s\+\S.*\)\+" transparent fold - syn region pythonFold start="^\z(\s*\)\(class\|def\)\s" skip="\(\s*\n\)\+\z1\s\+\(\S\|\%$\)" end="\(\s*\n\)\+\s*\(\S\|\%$\)"me=s-1 transparent fold - syn region pythonFold start="{" end="}" transparent fold - syn region pythonFold start="\[" end="\]" transparent fold -else - " This is fast but code inside triple quoted strings screws it up. It - " is impossible to fix because the only way to know if you are inside a - " triple quoted string is to start from the beginning of the file. If - " you have a fast machine you can try uncommenting the "sync minlines" - " and commenting out the rest. - syn sync match pythonSync grouphere NONE "):$" - syn sync maxlines=200 - "syn sync minlines=2000 -endif - -if version >= 508 || !exists("did_python_syn_inits") - if version <= 508 - let did_python_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink pythonStatement Statement - HiLink pythonImport Statement - HiLink pythonFunction Function - HiLink pythonConditional Conditional - HiLink pythonRepeat Repeat - HiLink pythonException Exception - HiLink pythonOperator Operator - - HiLink pythonComment Comment - HiLink pythonTodo Todo - - HiLink pythonError Error - - HiLink pythonString String - HiLink pythonUniString String - HiLink pythonRawString String - HiLink pythonUniRawString String - - HiLink pythonEscape Special - HiLink pythonEscapeError Error - HiLink pythonUniEscape Special - HiLink pythonUniEscapeError Error - HiLink pythonUniRawEscape Special - HiLink pythonUniRawEscapeError Error - - if exists("python_highlight_string_formatting") - HiLink pythonStrFormat Special - endif - - HiLink pythonNumber Number - HiLink pythonFloat Float - HiLink pythonOctalError Error - - if exists("python_highlight_builtins") - HiLink pythonBuiltinObj Structure - HiLink pythonBuiltinFunc Function - endif - - if exists("python_highlight_exceptions") - HiLink pythonExClass Structure - endif - - delcommand HiLink -endif - -let b:current_syntax = "python" diff --git a/syntax/python.vim b/syntax/python.vim index 0db6929..0e99225 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -145,7 +145,7 @@ syn keyword pythonStatement pass raise syn keyword pythonStatement global assert syn keyword pythonStatement lambda yield syn keyword pythonStatement with -syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite +syn keyword pythonDefinition def class nextgroup=pythonFunction skipwhite syn keyword pythonRepeat for while syn keyword pythonConditional if elif else syn keyword pythonPreCondit import from diff --git a/test.py b/test.py deleted file mode 100644 index af17c27..0000000 --- a/test.py +++ /dev/null @@ -1,133 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- -# Above the run-comment and file encoding comment. - -# Comments. - -# TODO FIXME XXX - -# Keywords. - -with break continue del exec return pass print raise global assert lambda yield -for while if elif else import from as try except finally and in is not or -def functionname -class Classname -def функция -class Класс - -# Builtin objects. - -True False Ellipsis None NotImplemented - -# Builtin function and types. - -__import__ abs all any apply basestring bool buffer callable chr classmethod -cmp coerce compile complex delattr dict dir divmod enumerate eval execfile file -filter float frozenset getattr globals hasattr hash help hex id input int -intern isinstance issubclass iter len list locals long map max min object oct -open ord pow property range raw_input reduce reload repr reversed round set -setattr slice sorted staticmethod str sum super tuple type unichr unicode vars -xrange zip - -# Builtin exceptions and warnings. - -BaseException Exception StandardError ArithmeticError LookupError -EnvironmentError - -AssertionError AttributeError EOFError FloatingPointError GeneratorExit IOError -ImportError IndexError KeyError KeyboardInterrupt MemoryError NameError -NotImplementedError OSError OverflowError ReferenceError RuntimeError -StopIteration SyntaxError IndentationError TabError SystemError SystemExit -TypeError UnboundLocalError UnicodeError UnicodeEncodeError UnicodeDecodeError -UnicodeTranslateError ValueError WindowsError ZeroDivisionError - -Warning UserWarning DeprecationWarning PendingDepricationWarning SyntaxWarning -RuntimeWarning FutureWarning ImportWarning UnicodeWarning - -# Decorators. - -@ decoratorname -@ object.__init__(arg1, arg2) - -# Numbers - -0 1 2 9 10 0x1f .3 12.34 0j 0j 34.2E-3 0b10 0o77 1023434 0x0 - -# Erroneous numbers - -077 100L 0xfffffffL 0L 08 0xk 0x 0b102 0o78 0o123LaB - -# Strings - -" test " ' test ' -""" - test -""" -''' - test -''' - -" \a\b\c\"\'\n\r \x34\077 \08 \xag" -r" \" \' " - -"testтест" - -b"test" - -b"test\r\n\xffff" - -b"тестtest" - -br"test" - -br"\a\b\n\r" - -# Formattings - -" %f " -b" %f " - -"{0.name!r:b} {0[n]} {name!s: } {{test}} {{}} {} {.__len__:s}" -b"{0.name!r:b} {0[n]} {name!s: } {{test}} {{}} {} {.__len__:s}" - -"${test} ${test ${test}aname $$$ $test+nope" -b"${test} ${test ${test}aname $$$ $test+nope" - -# Doctests. - -""" - Test: - >>> a = 5 - >>> a - 5 - - Test -""" - -''' - Test: - >>> a = 5 - >>> a - 5 - - Test -''' - -# Erroneous symbols or bad variable names. - -$ ? 6xav - -&& || === - -# Indentation errors. - - break - -# Trailing space errors. - - - break -""" - - test -"""