11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2018 , Python Software Foundation
2+ # Copyright (C) 2001-2019 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
77# Jarry Shaw <[email protected] >, 201888# Freesand Leo <[email protected] >, 20189+ # thautwarm <[email protected] >, 2019910#
1011#, fuzzy
1112msgid ""
1213msgstr ""
1314"Project-Id-Version : Python 3.7\n "
1415"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2018-10-29 09:36 +0900\n "
16+ "POT-Creation-Date : 2019-01-01 10:14 +0900\n "
1617"PO-Revision-Date : 2017-02-16 17:48+0000\n "
17- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2018 \n "
18+ "Last-Translator : thautwarm <twshere@outlook .com>, 2019 \n "
1819"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1920"MIME-Version : 1.0\n "
2021"Content-Type : text/plain; charset=UTF-8\n "
@@ -77,19 +78,24 @@ msgid ""
7778" rules with alternatives (aka \" sums\" ), the left-hand side class is "
7879"abstract: only instances of specific constructor nodes are ever created."
7980msgstr ""
81+ "抽象语法定义的每个左侧符号(比方说, :class:`ast.stmt` 或者 "
82+ ":class:`ast.expr`)定义了一个类。另外,在抽象语法定义的右侧,对每一个构造器也定义了一个类;这些类继承自树左侧的类。比如,:class:`ast.BinOp`"
83+ " 继承自 :class:`ast.expr`。对于多分支产生式(也就是\" 和规则\" ),树右侧的类是抽象的;只有特定构造器结点的实例能被构造。"
8084
8185#: ../../library/ast.rst:49
8286msgid ""
8387"Each concrete class has an attribute :attr:`_fields` which gives the names "
8488"of all child nodes."
85- msgstr ""
89+ msgstr "每个具体类都有个属性 :attr:`_fields`, 用来给出所有子节点的名字。 "
8690
8791#: ../../library/ast.rst:52
8892msgid ""
8993"Each instance of a concrete class has one attribute for each child node, of "
9094"the type as defined in the grammar. For example, :class:`ast.BinOp` "
9195"instances have an attribute :attr:`left` of type :class:`ast.expr`."
9296msgstr ""
97+ "每个具体类的实例对它每个子节点都有一个属性,对应类型如文法中所定义。比如,:class:`ast.BinOp` 的实例有个属性 "
98+ ":attr:`left`,类型是 :class:`ast.expr`."
9399
94100#: ../../library/ast.rst:56
95101msgid ""
@@ -99,6 +105,9 @@ msgid ""
99105"lists. All possible attributes must be present and have valid values when "
100106"compiling an AST with :func:`compile`."
101107msgstr ""
108+ "如果这些属性在文法中标记为可选(使用问号),对应值可能会是 "
109+ "``None``。如果这些属性有零或多个(用星号标记),对应值会用Python的列表来表示。所有可能的属性必须在用 :func:`compile` "
110+ "编译得到AST时给出,且是有效的值。"
102111
103112#: ../../library/ast.rst:65
104113msgid ""
@@ -109,64 +118,68 @@ msgid ""
109118"generated the node. The UTF-8 offset is recorded because the parser uses "
110119"UTF-8 internally."
111120msgstr ""
121+ ":class:`ast.expr` 和 :class:`ast.stmt` 子类的实例有 :attr:`lineno` 和 "
122+ ":attr:`col_offset` 属性。:attr:`lineno` 是源代码的行数(从1开始, 所以第一行行数是1),而 "
123+ ":attr:`col_offset` 是该生成节点第一个token的UTF-8字节偏移量。记录下UTF-8偏移量的原因是parser内部使用UTF-8。"
112124
113125#: ../../library/ast.rst:72
114126msgid ""
115127"The constructor of a class :class:`ast.T` parses its arguments as follows:"
116- msgstr ""
128+ msgstr "一个类的构造器 :class:`ast.T` 像下面这样parse它的参数。 "
117129
118130#: ../../library/ast.rst:74
119131msgid ""
120132"If there are positional arguments, there must be as many as there are items "
121133"in :attr:`T._fields`; they will be assigned as attributes of these names."
122- msgstr ""
134+ msgstr "如果有位置参数,它们必须和 :attr:`T._fields` 中的元素一样多;他们会像这些名字的属性一样被赋值。 "
123135
124136#: ../../library/ast.rst:76
125137msgid ""
126138"If there are keyword arguments, they will set the attributes of the same "
127139"names to the given values."
128- msgstr ""
140+ msgstr "如果有关键字参数,它们必须被设为和给定值同名的属性。 "
129141
130142#: ../../library/ast.rst:79
131143msgid ""
132144"For example, to create and populate an :class:`ast.UnaryOp` node, you could "
133145"use ::"
134- msgstr ""
146+ msgstr "比方说,要创建和填充节点 :class:`ast.UnaryOp`,你得用 :: "
135147
136148#: ../../library/ast.rst:91
137149msgid "or the more compact ::"
138- msgstr ""
150+ msgstr "或者更紧凑点 :: "
139151
140152#: ../../library/ast.rst:100
141153msgid "Abstract Grammar"
142- msgstr ""
154+ msgstr "抽象文法 "
143155
144156#: ../../library/ast.rst:102
145157msgid "The abstract grammar is currently defined as follows:"
146- msgstr ""
158+ msgstr "抽象文法目前定义如下 "
147159
148160#: ../../library/ast.rst:109
149161msgid ":mod:`ast` Helpers"
150- msgstr ""
162+ msgstr ":mod:`ast` 中的辅助函数 "
151163
152164#: ../../library/ast.rst:111
153165msgid ""
154166"Apart from the node classes, the :mod:`ast` module defines these utility "
155167"functions and classes for traversing abstract syntax trees:"
156- msgstr ""
168+ msgstr "除了节点类, :mod:`ast` 模块里为遍历抽象语法树定义了这些工具函数和类: "
157169
158170#: ../../library/ast.rst:116
159171msgid ""
160172"Parse the source into an AST node. Equivalent to ``compile(source, "
161173"filename, mode, ast.PyCF_ONLY_AST)``."
162174msgstr ""
175+ "把源码解析为AST节点。和 ``compile(source, filename, mode,ast.PyCF_ONLY_AST)`` 等价。"
163176
164177#: ../../library/ast.rst:120 ../../library/ast.rst:138
165178msgid ""
166179"It is possible to crash the Python interpreter with a sufficiently "
167180"large/complex string due to stack depth limitations in Python's AST "
168181"compiler."
169- msgstr ""
182+ msgstr "足够复杂或是巨大的字符串可能导致Python解释器的崩溃,因为Python的AST编译器是有栈深限制的。 "
170183
171184#: ../../library/ast.rst:127
172185msgid ""
0 commit comments