+
     hf  c                   s   R t Rt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RIH
t
 ^ RIHt ^ RIHt . R1Ot]
P                  ! 4       ]
P                   ! 4       ]
P"                  ! 4       ]
P$                  ! 4       3t]P(                  ! R]P*                  4      t]P(                  ! R]P*                  4      t]! R24      tR	t ! R
 R]4      t ! R R]4      t ! R R]4      tR3R lt R t!R t"R4R lt#R5R lt$R5R lt%R t&^t'^t( ! R R]4      t)R6R lt*R6R lt+R6R lt,R6R lt- ! R R]4      t.R t/R  t0R! t1R" t2 ! R# R$]4      t3]3t4R% t5R& t6R' t7R( t8R) t9R* t:R7R+ lt;R7R, lt<R- t=R. t>R/ t?R0 t@R# )8ac  Contains routines for printing protocol messages in text format.

Simple usage example::

  # Create a proto object and serialize it to a text proto string.
  message = my_proto_pb2.MyMessage(foo='bar')
  text_proto = text_format.MessageToString(message)

  # Parse a text proto string.
  message = text_format.Parse(text_proto, my_proto_pb2.MyMessage())
z kenton@google.com (Kenton Varda)N)decoder)type_checkers)
descriptor)text_encodingz-?inf(?:inity)?f?$znanf?$zgoogle.protobuf.Anyc                   s    ] tR t^GtRtRtR# )Errorz'Top-level module error for text_format. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       @/usr/lib/python3.14/site-packages/google/protobuf/text_format.pyr   r   G   s    /r   r   c                   sF   a a ] tR t^Kt oRtRV 3R lltR tR tRtVt	V ;t
# )
ParseErrorz3Thrown in case of text parsing or tokenizing error.c                s   < Ve=   Ve9   \        V4      pVe   VRP                  V4      ,          pRP                  WA4      pVe   \        \        V `  V4       M\        \        V `  4        W n        W0n        R # )Nz:{0}z	{0} : {1})strformatZsuperr   __init___line_column)selfmessagelineZcolumnZloc	__class__s   &&&& r   r   ZParseError.__init__N   sl    t/Ic		v}}V$$""30gJ&w/J&(JLr   c                    V P                   # N)r   r      &r   GetLineZParseError.GetLine[   s    ::r   c                r   r   )r   r   r   r   	GetColumnZParseError.GetColumn^   s    <<r   )r   r   )NNN)r   r   r   r	   r
   r   r   r   r   __classdictcell__Z__classcell__)r   __classdict__s   @@r   r   r   K   s     ; r   r   c                   s8   a  ] tR t^bt o R tR tR tR tRtV t	R# )
TextWriterc                s:    \         P                  ! 4       V n        R # r   )ioZStringIO_writer)r   as_utf8   &&r   r   ZTextWriter.__init__d   s    ;;=DLr   c                s8    V P                   P                  V4      # r   )r"   write)r   Zvalr$   r   r%   ZTextWriter.writeg   s    <<c""r   c                6    V P                   P                  4       # r   )r"   closer   r   r   r'   ZTextWriter.closej   s    <<r   c                r&   r   )r"   getvaluer   r   r   r(   ZTextWriter.getvaluem   s    <<  ""r   )r"   N)
r   r   r   r	   r   r%   r'   r(   r   r   r      @r   r    r    b   s     !# # #r   r    c                s    \        V4      p\        VV
VVVVVVVVV	VVVR7      pVP                  V 4       VP                  4       pVP	                  4        V'       d   VP                  4       # V# )a	  Convert protobuf message to text format.

Double values can be formatted compactly with 15 digits of
precision (which is the most that IEEE 754 "double" can guarantee)
using double_format='.15g'. To ensure that converting to text and back to a
proto will result in an identical value, double_format='.17g' should be used.

Args:
  message: The protocol buffers message.
  as_utf8: Return unescaped Unicode for non-ASCII characters.
      In Python 3 actual Unicode characters may appear as is in strings.
      In Python 2 the return value will be valid UTF-8 rather than only ASCII.
  as_one_line: Don't introduce newlines between fields.
  use_short_repeated_primitives: Use short repeated format for primitives.
  pointy_brackets: If True, use angle brackets instead of curly braces for
    nesting.
  use_index_order: If True, fields of a proto message will be printed using
    the order defined in source code instead of the field number, extensions
    will be printed at the end of the message and their relative order is
    determined by the extension number. By default, use the field number
    order.
  float_format (str): If set, use this to specify float field formatting
    (per the "Format Specification Mini-Language"); otherwise, shortest float
    that has same value in wire will be printed. Also affect double field
    if double_format is not set but float_format is set.
  double_format (str): If set, use this to specify double field formatting
    (per the "Format Specification Mini-Language"); if it is not set but
    float_format is set, use float_format. Otherwise, use ``str()``
  use_field_number: If True, print field numbers instead of names.
  descriptor_pool (DescriptorPool): Descriptor pool used to resolve Any types.
  indent (int): The initial indent level, in terms of spaces, for pretty
    print.
  message_formatter (function(message, indent, as_one_line) -> unicode|None):
    Custom formatter for selected sub-messages (usually based on message
    type). Use to pretty print parts of the protobuf for easier diffing.
  print_unknown_fields: If True, unknown fields will be printed.
  force_colon: If set, a colon will be added after the field name even if the
    field is a proto message.

Returns:
  str: A string of the text formatted protocol buffer message.
)print_unknown_fieldsforce_colon)r    _PrinterPrintMessager(   r'   rstrip)r   r#   as_one_lineuse_short_repeated_primitivespointy_bracketsuse_index_orderfloat_formatdouble_formatuse_field_numberdescriptor_poolindentmessage_formatterr+   r,   outprinterresults   &&&&&&&&&&&&&&   r   MessageToStringr=   q   s{    t 	7#	#/' 
w<<>&))+==?	-r   c                s    \        V 3/ VB p\        V\        4      '       d   V# VP                  R4      '       d   RMRpVP	                  V4      # )zFConvert protobuf message to encoded text format.  See MessageToString.r#   utf-8Zascii)r=   
isinstancebytesgetencode)r   ZkwargstextZcodecs   &,  r   MessageToBytesrD      sI     
	+F	+$eKZZ	**'%	U	r   c                 s    V P                   \        P                  P                  8H  ;'       dC    V P                  P
                  ;'       d%    V P                  P                  4       P                  # r   )typer   FieldDescriptorTYPE_MESSAGEmessage_typeZhas_options
GetOptionsZ	map_entry)fieldr   r   _IsMapEntryrK      sZ    
**
22??
? 4 4



(
(4 4



'
'
)
3
35r   c                 sX    \        WVVVVVVV	V
VVVVR 7      pVP                  V 4       R# )r:   r8   r#   r0   r1   r2   r3   r4   r5   r6   r7   r9   r+   r,   N)r-   r.   )r   r:   r8   r#   r0   r1   r2   r3   r4   r5   r6   r7   r9   r+   r,   r;   s   &&&&&&&&&&&&&&& r   r.   r.      sD     
g$A%%!'%)/' 
wr   c                N    \        W#WEWgWV
VVVR7      pVP                  W4       R# )%Print a single field name/value pair.r9   r+   r,   N)r-   
PrintFieldrJ   valuer:   r8   r#   r0   r1   r2   r3   r4   r5   r9   r+   r,   r;      &&&&&&&&&&&&&& r   rP   rP      s3     S'2$M'8*>!,.' 
U"r   c                rM   )z0Print a single field value (not including name).rO   N)r-   PrintFieldValuerQ   rS   r   rT   rT   
  s3     S'2$M'8*>!,.' 
%'r   c                s    Vf   ^ RI Hp VP                  4       p^ RI Hp VP                  4       p VP	                  V 4      pTP                  T4      pT! 4       #   \
         d     R# i ; i)a  Returns a protobuf message instance.

Args:
  type_name: Fully-qualified protobuf  message type name string.
  descriptor_pool: DescriptorPool instance.

Returns:
  A Message instance of type matching type_name, or None if the a Descriptor
  wasn't found matching type_name.
N)r7   )symbol_database)google.protobufr7   ZDefaultrU   ZFindMessageTypeByNameZKeyErrorZGetPrototype)Z	type_namer7   Zpool_modrU   Zdatabasemessage_descriptorrH   s   &&     r   _BuildMessageFromTypeNamerX   "  sq     ;&&(O-$$&((>>yI &&'9:,	 
 s   A A*)A*c                   sd   a  ] tR tRt o RtRR ltR tR tR tR t	R	 t
R
 tR tR tR tRtV tR# )r-   i@  z)Text format printer for protocol message.Nc                s    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        V	e   Wn        MWn        Wn	        Wn
        Wn        Wn        Wn        R# )a  Initialize the Printer.

Double values can be formatted compactly with 15 digits of precision
(which is the most that IEEE 754 "double" can guarantee) using
double_format='.15g'. To ensure that converting to text and back to a proto
will result in an identical value, double_format='.17g' should be used.

Args:
  out: To record the text format result.
  indent: The initial indent level for pretty print.
  as_utf8: Return unescaped Unicode for non-ASCII characters.
      In Python 3 actual Unicode characters may appear as is in strings.
      In Python 2 the return value will be valid UTF-8 rather than ASCII.
  as_one_line: Don't introduce newlines between fields.
  use_short_repeated_primitives: Use short repeated format for primitives.
  pointy_brackets: If True, use angle brackets instead of curly braces for
    nesting.
  use_index_order: If True, print fields of a proto message using the order
    defined in source code instead of the field number. By default, use the
    field number order.
  float_format: If set, use this to specify float field formatting
    (per the "Format Specification Mini-Language"); otherwise, shortest
    float that has same value in wire will be printed. Also affect double
    field if double_format is not set but float_format is set.
  double_format: If set, use this to specify double field formatting
    (per the "Format Specification Mini-Language"); if it is not set but
    float_format is set, use float_format. Otherwise, str() is used.
  use_field_number: If True, print field numbers instead of names.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  message_formatter: A function(message, indent, as_one_line): unicode|None
    to custom format selected sub-messages (usually based on message type).
    Use to pretty print parts of the protobuf for easier diffing.
  print_unknown_fields: If True, unknown fields will be printed.
  force_colon: If set, a colon will be added after the field name even if
    the field is a proto message.
NrL   )r   r:   r8   r#   r0   r1   r2   r3   r4   r5   r6   r7   r9   r+   r,   s   &&&&&&&&&&&&&&&r   r   Z_Printer.__init__C  sb    h HKL")F&**$ (',*. 4"r   c                s   RVP                   9  d   R# \        VP                  4       V P                  4      pV'       d   VP	                  VP
                  4       V P                  '       d   RMRpV P                  P                  V P                  R,          : RVP                   : RV: R24       V P                  V4       V P                  P                  V P                  '       d   RMR4       R	# R# )
z5Serializes if message is a google.protobuf.Any field./F:  []
T)Ztype_urlrX   ZTypeNamer7   ZMergeFromStringrR   r,   r:   r%   r8   _PrintMessageFieldValuer0   )r   r   Zpacked_messageZcolon   &&  r   _TryPrintAsAnyMessageZ_Printer._TryPrintAsAnyMessage  s    
'""".w/?/?/A/3/C/CEN$$W]]3%%%c2e
hhnnDKK#$5$5w7G7GOP
"">2
hhnnD,,,S$7r   c                s&   V P                  WP                  V P                  4      pVf   R# V P                  pVP	                  RV P                  ,          4       VP	                  V4       TP	                  V P                  '       d   RMR4       R# )NFr\   r_   T)r9   r8   r0   r:   r%   )r   r   Z	formattedr:   ra   r   _TryCustomFormatMessageZ _Printer._TryCustomFormatMessage  sm    &&wT=M=MNI
((CIIcDKK IIiIIT%%%c40r   c                s   V P                   '       d   V P                  V4      '       d   R# VP                  P                  \        8X  d   V P                  V4      '       d   R# VP                  4       pV P                  '       d   VP                  R R7       V EF(  w  r4\        V4      '       dD   \        V4       F2  pVP                  4       ! WTV,          R7      pV P                  W64       K4  	  KZ  VP                  \        P                  P                   8X  d   V P"                  '       df   VP$                  \        P                  P&                  8w  d=   VP$                  \        P                  P(                  8w  d   V P+                  W44       K  V F  pV P                  W74       K  	  EK  V P                  W44       EK+  	  V P,                  '       d"   V P/                  VP1                  4       4       R# R# )zYConvert protobuf message to text format.

Args:
  message: The protocol buffers message.
Nc                 s    V ^ ,          P                   '       d   V ^ ,          P                  # V ^ ,          P                  # )    )is_extensionnumberZindex)Zxr   r   Z<lambda>Z'_Printer.PrintMessage.<locals>.<lambda>  s+    qt'8'8'8!HadjjHr   )key)rg   rR   )r9   rc   
DESCRIPTOR	full_name_ANY_FULL_TYPE_NAMErb   Z
ListFieldsr3   ZsortrK   ZsortedGetEntryClassrP   labelr   rF   LABEL_REPEATEDr1   cpp_typeCPPTYPE_MESSAGECPPTYPE_STRING"_PrintShortRepeatedPrimitivesValuer+   _PrintUnknownFieldsZUnknownFields)r   r   ZfieldsrJ   rR   rg   Zentry_submsgZelements   &&      r   r.   Z_Printer.PrintMessage  sw    $">">w"G"G$$(;;""7++!FkkH  J	U		%=C ,,.3CjI,
//%
. ! ;;*44CCC...*"<"<"L"LL*"<"<"K"KK

1
1%
?gOOE+  	%' *    
w4467 !r   c                s   V P                   pV EF0  pVP                  RV P                  ,          4       VP                  \        VP                  4      4       VP
                  \        8X  d   V P                  '       d   VP                  R4       M*VP                  R4       V ;P                  ^,          un        V P                  VP                  4       V P                  '       d   VP                  R4       K  V ;P                  ^,          un        VP                  RV P                  ,          R,           4       EK2  VP
                  \        8X  Ed    \        P                  ! \        VP                  4      ^ \        VP                  4      4      w  rEV\        VP                  4      8X  d   V P                  '       d   VP                  R4       M*VP                  R4       V ;P                  ^,          un        V P                  X4       V P                  '       d   VP                  R4       EK(  V ;P                  ^,          un        VP                  RV P                  ,          R,           4       EKm  VP                  R4       VP                  \         P"                  ! VP                  R4      4       TP                  V P                  '       d   RMR	4       EK  VP                  R
4       VP                  \        VP                  4      4       TP                  V P                  '       d   RMR4       EK3  	  R#   \         d    ^ p ELi ; i)zPrint unknown fields.r\   z { z {
z} z}
z: "Fz" z"
z: r_   N)r:   r%   r8   r   Zfield_numberZ	wire_typeWIRETYPE_START_GROUPr0   rr   ZdataWIRETYPE_LENGTH_DELIMITEDr    Z_DecodeUnknownFieldSetZ
memoryviewlen	Exceptionr   CEscape)r   Zunknown_fieldsr:   rJ   Zembedded_unknown_messageZposs   &&    r   rr   Z_Printer._PrintUnknownFields  s8   
((C	iidkk!"	iiE&&'(	0	0
))E

))F

++
+  ,
))D/
++
+
))C$++%-
.??77	 -4,J,J$aUZZ-:
)#
 #ejj/!IIeIIfKK1K

"
"#;
<IIdOKK1KIIcDKK'%/0 ))F

))M))%**e<
=
))T---E6
: 			$		#ejj/"		)))#t4e  0  	#	s   A MMMc                s&   V P                   pVP                  RV P                  ,          4       V P                  '       d'   VP                  \	        VP
                  4      4       EM\VP                  '       d   VP                  R4       VP                  P                  4       P                  '       dy   VP                  \        P                  P                  8X  dP   VP                  \        P                  P                  8X  d'   VP                  VP                   P"                  4       MVP                  VP"                  4       VP                  R4       MjVP                  \        P                  P$                  8X  d'   VP                  VP                   P&                  4       MVP                  VP&                  4       V P(                  '       g*   VP*                  \        P                  P,                  8w  d   VP                  R4       R# R# )zPrint field name.r\   r]   r^   rZ   N)r:   r%   r8   r6   r   rf   re   containing_typerI   Zmessage_set_wire_formatrE   r   rF   rG   rl   ZLABEL_OPTIONALrH   ri   
TYPE_GROUPnamer,   rn   ro   )r   rJ   r:   s   && r   _PrintFieldNameZ_Printer._PrintFieldName  sM   
((CIIcDKK 	iiELL!"						#!!,,.FFFJJ*44AAAKK:55DDD
))E&&00
1
))EOO
$		#::33>>>		%$$))*
))EJJ
*44DDD 
iin	 	Er   c                s    V P                  V4       V P                  P                  R4       V P                  W4       V P                  P                  V P                  '       d	   R4       R# R4       R# )rN   r\   r_   N)r{   r:   r%   rT   r0   )r   rJ   rR      &&&r   rP   Z_Printer.PrintField  sN    HHNN3&HHNN$***355r   c                s   V P                  V4       V P                  P                  R4       \        \	        V4      ^,
          4       F6  pV P                  WV,          4       V P                  P                  R4       K8  	  V P                  WR,          4       V P                  P                  R4       V P                  P                  V P                  '       d	   R4       R# R4       R# )z("Prints short repeated primitives value.z [z, r^   r\   r_   N)r{   r:   r%   Zrangeru   rT   r0   )r   rJ   rR   Zis   &&& r   rq   Z+_Printer._PrintShortRepeatedPrimitivesValue&  s     	HHNN43u:>"
5(+
hhnnT # 	b	*HHNN3HHNN$***355r   c                s0   V P                   '       d   R pRpMRpRpV P                  '       dQ   V P                  P                  RV,          4       V P	                  V4       V P                  P                  V4       R# V P                  P                  RV,          4       V ;P
                  ^,          un        V P	                  V4       V ;P
                  ^,          un        V P                  P                  RV P
                  ,          V,           4       R# )<>{}z%s z%s
r\   N)r2   r0   r:   r%   r.   r8   )r   rR   ZopenbZclosebra   r   r`   Z _Printer._PrintMessageFieldValue2  s    efef
hhnnUU]#

hhnnV
hhnnVe^$
kkQk

kkQk
hhnnS4;;&/0r   c                s   V P                   pVP                  \        P                  P                  8X  d   V P                  V4       R# VP                  \        P                  P                  8X  dd   VP                  P                  P                  VR4      pVe   VP                  VP                  4       R# VP                  \        V4      4       R# VP                  \        P                  P                  8X  d   VP                  R4       \        V\        4      '       d%   V P                  '       g   VP!                  R4      pMTpVP"                  \        P                  P$                  8X  d   RpMV P                  pVP                  \&        P(                  ! WV4      4       VP                  R4       R# VP                  \        P                  P*                  8X  d/   V'       d   VP                  R4       R# VP                  R4       R# VP                  \        P                  P,                  8X  d   V P.                  e.   VP                  RP1                  V P.                  V4      4       R# \2        P4                  ! V4      '       d   VP                  \        V4      4       R# VP                  \        \6        P8                  ! V4      4      4       R# VP                  \        P                  P:                  8X  d<   V P<                  e.   VP                  RP1                  V P<                  V4      4       R# VP                  \        V4      4       R# )zPrint a single field value (not including name).

For repeated fields, the value should be a single element.

Args:
  field: The descriptor of the field to be printed.
  value: The value of the field.
N"r>   Ftruefalsez{1:{0}})r:   rn   r   rF   ro   r`   ZCPPTYPE_ENUM	enum_typevalues_by_numberrA   r%   rz   r   rp   r?   r#   rB   rE   
TYPE_BYTESr   rw   ZCPPTYPE_BOOLZCPPTYPE_FLOATr4   r   mathZisnanr   ZToShortestFloatZCPPTYPE_DOUBLEr5   )r   rJ   rR   r:   
enum_valueZ	out_valueZout_as_utf8s   &&&    r   rT   Z_Printer.PrintFieldValueE  s$    ((C~~33CCC
""5)	:55BB	B??3377tDj				*//"		#e*	:55DD	D	iio	E3		LL)			z11<<	<ll	ii%%i=>	iio	:55BB	B			&		'	:55CC	C				&		)""4#4#4e<=::e
))CJ

))C55e<=
>
..J66EE
E



(	ii	  !3!3U;<	iiE
r   )r0   r#   r7   r5   r4   r,   r8   r9   r:   r2   r+   r6   r3   r1   rd   FFFFFNNFNNFF)r   r   r   r	   r
   r   rb   rc   r.   rr   r{   rP   rq   r`   rT   r   r   r)   r*   r   r-   r-   @  sC     1D#L 	%8N55n:6
61&0 0r   r-   c           	     r    \        T P                  \        V \        4      '       d   RMR4      VVVVVR7      # )a  Parses a text representation of a protocol message into a message.

NOTE: for historical reasons this function does not clear the input
message. This is different from what the binary msg.ParseFrom(...) does.
If text contains a field already set in message, the value is appended if the
field is repeated. Otherwise, an error is raised.

Example::

  a = MyProto()
  a.repeated_field.append('test')
  b = MyProto()

  # Repeated fields are combined
  text_format.Parse(repr(a), b)
  text_format.Parse(repr(a), b) # repeated_field contains ["test", "test"]

  # Non-repeated fields cannot be overwritten
  a.singular_field = 1
  b.singular_field = 2
  text_format.Parse(repr(a), b) # ParseError

  # Binary version:
  b.ParseFromString(a.SerializeToString()) # repeated_field is now "test"

Caller is responsible for clearing the message as needed.

Args:
  text (str): Message text representation.
  message (Message): A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool (DescriptorPool): Descriptor pool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  Message: The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
   
r_   r7   allow_unknown_field)
ParseLinessplitr?   r@   rC   r   allow_unknown_extensionallow_field_numberr7   r      &&&&&&r   Parser   x  s:    d 
DJJ
4(?(?uUK+&$3(;
= =r   c           	     r   )a}  Parses a text representation of a protocol message into a message.

Like Parse(), but allows repeated values for a non-repeated field, and uses
the last one. This means any non-repeated, top-level fields specified in text
replace those in the message.

Args:
  text (str): Message text representation.
  message (Message): A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool (DescriptorPool): Descriptor pool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  Message: The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
r   r_   r   )
MergeLinesr   r?   r@   r   r   r   Merger     s:    : 

jj*T511u=%-
/ /r   c                B    \        VVVVR7      pVP                  W4      # )a  Parses a text representation of a protocol message into a message.

See Parse() for caveats.

Args:
  lines: An iterable of lines of a message's text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
r   )_Parserr   linesr   r   r   r7   r   Zparser   &&&&&& r   r   r     -    6 *%#2':<& 
		5	**r   c                r   )a  Parses a text representation of a protocol message into a message.

See Merge() for more details.

Args:
  lines: An iterable of lines of a message's text representation.
  message: A protocol buffer message to merge into.
  allow_unknown_extension: if True, skip over missing extensions and keep
    parsing
  allow_field_number: if True, both field number and field name are allowed.
  descriptor_pool: A DescriptorPool used to resolve Any types.
  allow_unknown_field: if True, skip over unknown field and keep
    parsing. Avoid to use this option if possible. It may hide some
    errors (e.g. spelling error on field name)

Returns:
  The same message passed as argument.

Raises:
  ParseError: On text parsing problems.
r   )r   r   r   r   r   r   r     r   r   c                   sh   a  ] tR tRt o RtRR ltR tR tR tR t	R	 t
R
 t]R 4       tR tRtV tR# )r   i  z(Text format parser for protocol message.Nc                s6    Wn         W n        W0n        W@n        R # r   )r   r   r7   r   )r   r   r   r7   r   s   &&&&&r   r   Z_Parser.__init__  s    
 $; 0*2r   c                6    RV n         V P                  W4       V# )zBParses a text representation of a protocol message into a message.F_allow_multiple_scalars_ParseOrMerger   r   r   r|   r   r   Z_Parser.ParseLines)  s    #(D u&Nr   c                r   )zBMerges a text representation of a protocol message into a message.Tr   r   r|   r   r   Z_Parser.MergeLines/  s    #'D u&Nr   c                s    R V 4       p\        V4      pVP                  4       '       g   V P                  WB4       K)  R# )zConverts a text representation of a protocol message into a message.

Args:
  lines: Lines of a message's text representation.
  message: A protocol buffer message to merge into.

Raises:
  ParseError: On text parsing problems.
c              3   st   "   T F.  p\        V\        4      '       d   TMVP                  R 4      x  K0  	  R# 5i)r>   N)r?   r   Zdecode)Z.0r      & r   Z	<genexpr>Z(_Parser._ParseOrMerge.<locals>.<genexpr>@  s1      D 4%%4;;w+??s   68N)	TokenizerAtEnd_MergeField)r   r   r   Z	str_lines	tokenizer   &&&  r   r   Z_Parser._ParseOrMerge5  s=    I )$Ioo
y*  r   c                sH   VP                   pVP                  \        8X  Ed   VP                  R4      '       Ed   V P	                  V4      w  rEVP                  R4       VP                  R4       VP                  R4      '       d   RpMVP                  R4       Rp\        VV P                  4      pV'       g   \        RV,          4      hVP                  V4      '       g@   VP                  4       '       d   VP                  R	V: R
24      hV P                  W4       KV  RpVP                  VVVR7       R# VP                  R4      '       Ed&   VP                  4       .p	VP                  R4      '       d"   V	P                  VP                  4       4       K8  RP                  V	4      p	VP                   '       g#   VP                  RVP                  ,          4      hVP"                  P%                  V	4      p
V
'       g.   V P&                  '       d   Rp
MLVP                  RV	,          4      hW:P(                  8w  d%   VP                  RV	: RVP                  : R
24      hVP                  R4       EMVP+                  4       p	V P,                  '       dv   V	P/                  4       '       d`   \1        V	RR4      pVP2                  P5                  VR4      p
V
'       g.   VP                   '       d   VP"                  P7                  V4      p
MVP8                  P5                  V	R4      p
V
'       g^   VP8                  P5                  V	P;                  4       R4      p
V
'       d,   V
P<                  \>        P@                  PB                  8w  d   Rp
V
'       dG   V
P<                  \>        P@                  PB                  8X  d   V
PD                  PF                  V	8w  d   Rp
V
'       g7   V PH                  '       g%   VP                  RVP                  : RV	: R
24      hV
'       Ed   V PJ                  '       g   V
PL                  '       d   VPO                  V
PL                  PF                  4      pVe[   WPF                  8w  dK   VP                  RV
PF                  : RV: RV
PL                  PF                  : RVP                  : R
2	4      hV
PP                  \>        P@                  PR                  8X  d   VP                  R4       V PT                  pMVP                  R4       V PV                  pV
PX                  \>        P@                  PZ                  8X  de   VP                  R4      '       dN   VP                  R4      '       g6    V! WV
4       VP                  R4      '       d   MOVP                  R4       K5  M;V! WV
4       M1V P&                  '       g   V PH                  '       g   Q h\]        V4       VP                  R4      '       g   VP                  R4       R# R# )zMerges a single protocol message field into a message.

Args:
  tokenizer: A tokenizer to parse the field name and values.
  message: A protocol message to record the data.

Raises:
  ParseError: In case of text parsing problems.
r]   r^   rZ   r~   r   r   r   z$Type %s not found in descriptor pool
Expected "".F)type_url_prefixdeterministicN.z+Message type "%s" does not have extensions.zExtension "%s" not registered. Did you import the _pb2 module which defines it? If you are trying to place the extension in the MessageSet field of another message that is in an Any or MessageSet field, that message's _pb2 module must be imported as wellzExtension "z " does not extend message type "TMessage type "z" has no field named "zField "z!" is specified along with field "z", another member of oneof "z" for message type ",;)/rh   ri   rj   
TryConsume_ConsumeAnyTypeUrlConsumerX   r7   r   r   ParseErrorPreviousTokenr   ZPackConsumeIdentifierappendjoinZis_extendable
ExtensionsZ_FindExtensionByNamer   rx   ConsumeIdentifierOrNumberr   ZisdigitParseIntegerZfields_by_numberrA   Z_FindExtensionByNumberfields_by_nameZlowerrE   r   rF   ry   rH   rz   r   r   Zcontaining_oneofZ
WhichOneofrn   ro   _MergeMessageField_MergeScalarFieldrl   rm   _SkipFieldContents)r   r   r   rW   r   Zpacked_type_nameZexpanded_any_end_tokenZexpanded_any_sub_messager   rz   rJ   rf   Zwhich_oneofZmergers   &&&           r   r   Z_Parser._MergeFieldG  s    !++$$(;;S!!*.*A*A)*L'o3			c	"	"!$#!$!:;K;?;O;O"Q%?)* + 	+$$%;<<??113I3L M M=mll+#2!.  0 C  ))+,d  %%I//12XXd^d---//9(()* 	*   55d;e '''%11E HL	LM M !6!66//%//12 	2  002d		 	 	 T\\^^dD$/"3377E+999$$;;FC%"1155dDA
 $3377

dK%uzzZ%?%?%J%JJEejjJ$>$>$I$II##t+%4333//))412 	2 u)))e.D.D.D (()?)?)D)DE"{jj'@11 zz;(>(>(C(C!++-. . 
:55EE	ES!((#''
++33BB
B


s
#
###C((9u-##C((c" ) 	y5) ***d.F.F.FGF# $$3 %r   c                s   VP                  4       .pVP                  R4       VP                  VP                  4       4       VP                  R4       VP                  VP                  4       4       VP                  R4       VP                  4       .pVP                  R4      '       d"   VP                  VP                  4       4       K8  RP	                  V4      RP	                  V4      3# )zBConsumes a google.protobuf.Any type URL and returns the type name.r   rY   )r   r   r   r   r   )r   r   Zprefixrz   ra   r   r   Z_Parser._ConsumeAnyTypeUrl  s     ))+,Fc
MM)--/0c
MM)--/0c'')*D


s
#
#
kk)--/088FSXXd^++r   c                s8   \        V4      pVP                  R4      '       d   RpMVP                  R4       RpVP                  \        P
                  P                  8X  d   VP                  '       d$   VP                  V,          P                  4       pEMnV'       d+   \        W#P                  4      P                  4       ! 4       pEM<\        W#P                  4      P                  4       pEMVP                  '       dv   V P                  '       gP   VP                  V4      '       d9   VP                  RVP                   P"                  : RVP"                  : R24      hVP                  V,          pMV P                  '       gZ   VP%                  VP                  4      '       d9   VP                  RVP                   P"                  : RVP                  : R24      h\        W#P                  4      pVP'                  4        VP                  V4      '       g@   VP)                  4       '       d   VP                  R	V: R
24      hV P+                  W4       KV  V'       d   VP,                  P.                  R,          P0                  pV\        P
                  P2                  8X  dD   \        W#P                  4      VP4                  ,          pVP7                  VP8                  4       R# VP8                  \        W#P                  4      VP4                  &   R# R# )a  Merges a single scalar field into a message.

Args:
  tokenizer: A tokenizer to parse the field value.
  message: The message of which field is a member.
  field: The descriptor of the field to be merged.

Raises:
  ParseError: In case of text parsing problems.
r~   r   r   r   r   " should not have multiple "" extensions.	" fields.r   r   rR   N)rK   r   r   rl   r   rF   rm   re   r   Zaddgetattrrz   rk   r   HasExtensionr   rh   ri   HasFieldZSetInParentr   r   rH   r   rn   ro   rg   ZCopyFromrR   )	r   r   r   rJ   Zis_map_entryZ	end_tokenZsub_messageZvalue_cpptyperR   s	   &&&&     r   r   Z_Parser._MergeMessageField  s:    u%LC  ii{{j00???				((/335gzz2@@BDgzz2668				,,,  ''11!!++U__>? ? ((/ ,,,UZZ((11!!++UZZ9: : gzz2""9--			//I0OPP
y.((77@IIm	*44DD	D,[__={(()8C8I8I$[__5 r   c                s`    V P                   p\        VR 4      ;'       d    VP                  R8H  # )syntaxproto3)rh   hasattrr   )r   rW   r   r   _IsProto3SyntaxZ_Parser._IsProto3Syntax  s6     ++&1 2 2%%13r   c                sn	   V P                   pRpVP                  \        P                  P                  \        P                  P
                  \        P                  P                  39   d   \        V4      pEMcVP                  \        P                  P                  \        P                  P                  \        P                  P                  39   d   \        V4      pEMVP                  \        P                  P                  \        P                  P                  39   d   \        V4      pEMVP                  \        P                  P                  \        P                  P                   39   d   \#        V4      pEMZVP                  \        P                  P$                  \        P                  P&                  39   d   VP)                  4       pEMVP                  \        P                  P*                  8X  d   VP-                  4       pMVP                  \        P                  P.                  8X  d   VP1                  4       pMVP                  \        P                  P2                  8X  d   VP5                  4       pMWVP                  \        P                  P6                  8X  d   VP9                  V4      pM\;        RVP                  ,          4      hVP<                  \        P                  P>                  8X  d]   VP@                  '       d%   VPB                  V,          PE                  V4       R# \G        W#PH                  4      PE                  V4       R# VP@                  '       d   V PJ                  '       gg   V PM                  V4      '       gP   VPO                  V4      '       d9   VPQ                  RVPR                  PT                  : RVPT                  : R24      hWRPB                  V&   R# RpV PJ                  '       gR   V PM                  V4      '       d    \W        \G        W#PH                  4      4      pMVPY                  VPH                  4      pV'       d9   VPQ                  RVPR                  PT                  : RVPH                  : R24      h\[        W#PH                  V4       R# )a(  Merges a single scalar field into a message.

Args:
  tokenizer: A tokenizer to parse the field value.
  message: A protocol message to record the data.
  field: The descriptor of the field to be merged.

Raises:
  ParseError: In case of text parsing problems.
  RuntimeError: On runtime errors.
NzUnknown field type %dr   r   r   Fr   ).r   rE   r   rF   Z
TYPE_INT32ZTYPE_SINT32ZTYPE_SFIXED32_ConsumeInt32Z
TYPE_INT64ZTYPE_SINT64ZTYPE_SFIXED64_ConsumeInt64ZTYPE_UINT32ZTYPE_FIXED32_ConsumeUint32ZTYPE_UINT64ZTYPE_FIXED64_ConsumeUint64Z
TYPE_FLOATZTYPE_DOUBLEConsumeFloatZ	TYPE_BOOLConsumeBoolZTYPE_STRINGConsumeStringr   ConsumeByteStringZ	TYPE_ENUMConsumeEnumZRuntimeErrorrl   rm   re   r   r   r   rz   r   r   r   r   rh   ri   Zboolr   Zsetattr)r   r   r   rJ   Z_rR   Zduplicate_errors   &&&&   r   r   Z_Parser._MergeScalarField"  sa    	$$AEzzj00;; 00<< 00>>@ @ I&e	
22=="22>>"22@@B 
B I&e	
22>>"22??A 
AY'e	
22>>"22??A 
AY'e	
22=="22>>@ 
@$$&e	z11;;	;##%e	z11==	=%%'e	z11<<	<))+e	z11;;	;##E*e05::=>>{{j00???				5!((/$++E2				,,,$$W--  ''11!!++U__>? ? ',

U
#+++!!'** #77JJ#?@O%..uzz:O11!!++UZZ9: : '::u
-r   )r   r   r   r   r7   FFNF)r   r   r   r	   r
   r   r   r   r   r   r   r   Zstaticmethodr   r   r   r   r)   r*   r   r   r     sO     03+$I X,8Jt 3 3
I. I.r   r   c                s    V P                  R4      '       d<   V P                  R4      '       g%   V P                  R4      '       g   \        V 4       R# \        V 4       R# )zwSkips over contents (value or message) of a field.

Args:
  tokenizer: A tokenizer to parse the field name and values.
rZ   r   r~   N)r   	LookingAt_SkipFieldValue_SkipFieldMessager   r   r   r   r   n  sK     #y':':	( (&&s++Ii r   c                sT   V P                  R4      '       dL   V P                  4        V P                  R4      '       d   V P                  4        K)  V P                  R4       MV P                  4        \	        V 4       V P                  R4      '       g   V P                  R4       R# R# )zzSkips over a complete field (name and value/message).

Args:
  tokenizer: A tokenizer to parse the field name and values.
r]   r   r^   r   r   N)r   r   r   r   r   r   r   r   
_SkipFieldr     s     #!


s
#
#!!#c'')Y 
		c	"	" 
#r   c                s    V P                  R4      '       d   RpMV P                  R4       RpV P                  R4      '       g%   V P                  R4      '       g   \        V 4       K;  V P                  V4       R# )z`Skips over a field message.

Args:
  tokenizer: A tokenizer to parse the field name and values.
r~   r   r   r   N)r   r   r   r   )r   Z	delimiterr   r   r   r     sd     #IcI$$Y-@-@-E-EyIr   c                sF   V P                  4       '       d   V P                  4       '       d   K  R# V P                  4       '       g[   \        V 4      '       gH   \        V 4      '       g5   V P	                  4       '       g   \        RV P                  ,           4      hR# R# R# R# )zSkips over a field value.

Args:
  tokenizer: A tokenizer to parse the field name and values.

Raises:
  ParseError: In case an invalid field value is found.
NzInvalid field value: )TryConsumeByteStringTryConsumeIdentifier_TryConsumeInt64_TryConsumeUint64TryConsumeFloatr   tokenr   r   r   r   r     s     ##%%

(
(
*
*



(
(
*
*
9
%
%.?	.J.J

#
#
%
%
,y>
?? & /K
% +r   c                   sH  a ] tR tRt oRt]P                  ! R4      t]P                  ! R]P                  4      t	]P                  ! R]P                  4      t
]P                  ! RP                  RR.] U u. uF  p R	P                  V R
7      NK  	  up ,           4      4      t]P                  ! R4      t]P                  ! R4      tR*R ltR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R  t$R! t%R" t&R# t'R$ t(R% t)R& t*R' t+R(t,Vt-R)# u up i )+r   i  zProtocol buffer text representation tokenizer.

This class handles the lower level string parsing by splitting it into
meaningful tokens.

It was directly ported from the Java protocol buffer API.
z\s+z	(\s*#.*$)z(\s|(#.*$))+Z|z[a-zA-Z_][0-9a-zA-Z_+-]*z#([0-9+-]|(\.[0-9]))[0-9a-zA-Z_.+-]*z0{qt}[^{qt}\n\\]*((\\.)+[^{qt}\n\\]*)*({qt}|\\?$))Zqtz
[^\d\W]\w*z\w+c                sN   ^ V n         RV n        ^ V n        RV n        RV n        \        V4      V n        RV n        ^ V n        ^ V n	        RV n
        W n        T;'       d    V P                  ;'       g    V P                  V n        V P                  4        V P!                  4        R# )rd   Nr[   Tr}   )	_positionr   r   _token_startr   Ziter_lines_current_line_previous_line_previous_column_more_lines_skip_comments_WHITESPACE_OR_COMMENT_WHITESPACE_whitespace_pattern_SkipWhitespace	NextToken)r   r   Zskip_commentsr|   r   r   ZTokenizer.__init__  s    DNDJDLDDJu+DKDDDD' - M M$2M2M !4 !4#'#3#3 	NNr   c                s     V P                   V8H  # r   r   r   r   r$   r   r   ZTokenizer.LookingAt  s    ::r   c                s$    V P                   '       * # )zRChecks the end of the text was reached.

Returns:
  True iff the end was reached.
r   r   r   r   r   ZTokenizer.AtEnd  s     zz>r   c                s   \        V P                  4      V P                  8:  d>    \        V P                  4      V n        V ;P
                  ^,          un        ^ V n        Ka  R#   \         d    RT n        RT n         R# i ; i)i   r[   FN)ru   r   r   Znextr   r   ZStopIterationr   r   r   r   _PopLineZTokenizer._PopLine  sn    
d  
!T\\
1!$++. 	

a
 2   s   A$ $B Bc                s    V P                  4        V P                  P                  V P                  V P                  4      pV'       g   R# \        VP                  ^ 4      4      pV ;P                  V,          un        K  )TN)r   r   matchr   r   ru   group)r   r   Zlength   &  r   r   ZTokenizer._SkipWhitespace  sV    

mmo&&,,T-?-?Ne5;;q>"f
llflr   c                sL    V P                   V8X  d   V P                  4        R# R# )zuTries to consume a given piece of text.

Args:
  token: Text to consume.

Returns:
  True iff the text was consumed.
TF)r   r   r   r$   r   r   ZTokenizer.TryConsume
  s      zzU
nnr   c                sd    V P                  V4      '       g   V P                  RV,          4      hR# )ztConsumes a piece of text.

Args:
  token: Text to consume.

Raises:
  ParseError: If the text couldn't be consumed.
zExpected "%s".N)r   r   r   r$   r   r   ZTokenizer.Consume  s-     ??5!!OO,u455 "r   c                s    V P                   pV P                  P                  V4      '       g   V P                  R 4      hV P	                  4        V# )zExpected comment.)r   _COMMENTr   r   r   r   r<   r   r   ConsumeCommentZTokenizer.ConsumeComment$  s?    ZZF==v&&OO/00NNMr   c                s    V P                   ^ 8H  ;'       d    V P                  ^ 8H  pV P                  pV P                  4       pV P                  V8H  ;'       d    V'       * pWC3# )zCConsumes a comment, returns a 2-tuple (trailing bool, comment str).)r   r   r   r   )r   Zjust_startedZbefore_parsingZcommentZtrailings   &    r   ConsumeCommentOrTrailingCommentZ)Tokenizer.ConsumeCommentOrTrailingComment+  sk    
 ::?88t||q'8L((N!!#G ##~5 % %$$  r   c                L     V P                  4        R #   \         d     R# i ; iTF)r   r   r   r   r   r   ZTokenizer.TryConsumeIdentifier;  (    
     ##c                s    V P                   pV P                  P                  V4      '       g   V P                  R4      hV P	                  4        V# )Consumes protocol message field identifier.

Returns:
  Identifier string.

Raises:
  ParseError: If an identifier couldn't be consumed.
zExpected identifier.)r   _IDENTIFIERr   r   r   r   r   r   r   ZTokenizer.ConsumeIdentifierB  sC     ZZF!!&))OO233NNMr   c                r   r   )r   r   r   r   r   TryConsumeIdentifierOrNumberZ&Tokenizer.TryConsumeIdentifierOrNumberQ  s(    
$$& r   c                s    V P                   pV P                  P                  V4      '       g   V P                  RV,          4      hV P	                  4        V# )r   z&Expected identifier or number, got %s.)r   _IDENTIFIER_OR_NUMBERr   r   r   r   r   r   r   Z#Tokenizer.ConsumeIdentifierOrNumberX  sH     ZZF%%++F33OODvMNNNNMr   c                r   r   )ConsumeIntegerr   r   r   r   TryConsumeIntegerZTokenizer.TryConsumeIntegerg  s(    
 r   c                     \        V P                  4      pT P                  4        T#   \         d    pT P                  \	        T4      4      hRp?ii ; i)zwConsumes an integer number.

Returns:
  The integer parsed.

Raises:
  ParseError: If an integer couldn't be consumed.
N)_ParseAbstractIntegerr   
ValueErrorr   r   r   r   r<   er   r   r   ZTokenizer.ConsumeIntegern  sK    $$TZZ0f 	NNM  $OOCF##$   ) AAAc                r   r   )r   r   r   r   r   r   ZTokenizer.TryConsumeFloat~  s(    
 r   c                r   )zConsumes an floating point number.

Returns:
  The number parsed.

Raises:
  ParseError: If a floating point number couldn't be consumed.
N)
ParseFloatr   r  r   r   r   r  r   r   r   ZTokenizer.ConsumeFloat  sK    $$**%f 	NNM  $OOCF##$r  c                r   )zwConsumes a boolean value.

Returns:
  The bool parsed.

Raises:
  ParseError: If a boolean value couldn't be consumed.
N)	ParseBoolr   r  r   r   r   r  r   r   r   ZTokenizer.ConsumeBool  sK    $$f 	NNM  $OOCF##$r  c                r   r   )r   r   r   r   r   r   ZTokenizer.TryConsumeByteString  r   r   c                s    V P                  4       p \        VR4      #   \         d   pT P                  T4      hRp?ii ; i)zwConsumes a string value.

Returns:
  The string parsed.

Raises:
  ParseError: If a string value couldn't be consumed.
r>   N)r   r   ZUnicodeDecodeError_StringParseError)r   Z	the_bytesr  r   r   r   ZTokenizer.ConsumeString  sE     &&(I&G$$ &""1%%&s    ?:?c                s    V P                  4       .pV P                  '       d>   V P                  ^ ,          \        9   d"   VP                  V P                  4       4       KO  RP	                  V4      # )zConsumes a byte array value.

Returns:
  The array parsed (as a string).

Raises:
  ParseError: If a byte array value couldn't be consumed.
r   )_ConsumeSingleByteStringr   _QUOTESr   r   )r   Zthe_listr   r   r   ZTokenizer.ConsumeByteString  sQ     --/0H
***A'1ood335688Hr   c                s   V P                   p\        V4      ^8  g   V^ ,          \        9  d   V P                  RV: 24      h\        V4      ^8  g   VR,          V^ ,          8w  d   V P                  RV: 24      h \        P
                  ! V^R 4      pT P                  4        T#   \         d    pT P                  \        T4      4      hRp?ii ; i)a/  Consume one token of a string literal.

String literals (whether bytes or text) can come in multiple adjacent
tokens which are automatically concatenated, like in C or Python.  This
method only consumes one token.

Returns:
  The token parsed.
Raises:
  ParseError: When the wrong format data is found.
zExpected string but found: zString missing ending quote: Nr}   )	r   ru   r	  r   r   Z	CUnescaper  r   r   )r   rC   r<   r  s   &   r   r  Z"Tokenizer._ConsumeSingleByteString  s     ::D
4y1}Qw.OOtEFF
4y1}RDG+OOGHH$&&tAbz2f 	NNM  $OOCF##$s   ?B* *C5CCc                s     \        WP                  4      pT P                  4        T#   \         d    pT P                  \	        T4      4      hR p?ii ; ir   )	ParseEnumr   r  r   r   r   )r   rJ   r<   r  ra   r   r   ZTokenizer.ConsumeEnum  sK    $

+f 	NNM  $OOCF##$r  c                s^    \        WP                  ^,           V P                  ^,           4      # )zCreates and *returns* a ParseError for the previously read token.

Args:
  message: A message to set for the exception.

Returns:
  A ParseError instance.
)r   r   r   r   r   r$   r   r   Z!Tokenizer.ParseErrorPreviousToken  s,     g22Q6++a/1 1r   c                s    \        RV P                  ,           R,           V,           V P                  ^,           V P                  ^,           4      # )z9Creates and *returns* a ParseError for the current token.'z': )r   r   r   r   r  r$   r   r   ZTokenizer.ParseError  s<    dT///&87Bjj1ndllQ&68 8r   c                sD    V P                  R \        V4      ,           4      # )zCouldn't parse string: )r   r   )r   r  r$   r   r  ZTokenizer._StringParseError  s    ??5A>??r   c                sr   V P                   V n        V P                  V n        V ;P                  \	        V P
                  4      ,          un        V P                  4        V P                  '       g
   RV n        R# V P                  P                  V P                  V P                  4      pV'       gC   V P                  '       g1   V P                  P                  V P                  V P                  4      pV'       d   VP                  ^ 4      pW n        R# V P                  V P                  ,          V n        R# )z Reads the next meaningful token.r[   N)r   r   r   r   ru   r   r   r   _TOKENr   r   r   r   r   )r   r   r   r   r   r   ZTokenizer.NextToken  s    **D LLDLLC

O#LdjKKd00$,,?E,,,mm!!$"4"4dllCekk!nej%%dll3djr   )r   r   r   r   r   r   r   r   r   r   r   r   N)T).r   r   r   r	   r
   recompiler   Z	MULTILINEr   r   r   r	  r   r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r  r   r   r   )Zmarkr   s   0@r   r   r     sK     

6"+ZZbll3(::or||D::chh!,   $ :@@D@I   & 

=)+**V,"

6    &4
18
@4 4_	s   6Dr   c                    \        V RRR7      # )Consumes a signed 32bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If a signed 32bit integer couldn't be consumed.
TF	is_signedis_long_ConsumeIntegerr   r   r   r   r     s     
dE	BBr   c                    \        V RRR7      # )zConsumes an unsigned 32bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If an unsigned 32bit integer couldn't be consumed.
Fr  r  r   r   r   r   r   (  s     
eU	CCr   c                 B     \        V 4       R #   \         d     R# i ; ir   )r   r   r   r   r   r   r   7  s$    )	     c                r  )r  Tr  r  r   r   r   r   r   ?  s     
dD	AAr   c                 r  r   )r   r   r   r   r   r   r   N  s$    9	 r  c                r  )zConsumes an unsigned 64bit integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.

Returns:
  The integer parsed.

Raises:
  ParseError: If an unsigned 64bit integer couldn't be consumed.
FTr  r  r   r   r   r   r   V  s     
eT	BBr   c                s     \        V P                  WR7      pT P                  4        T#   \         d    pT P                  \	        T4      4      hRp?ii ; i)aC  Consumes an integer number from tokenizer.

Args:
  tokenizer: A tokenizer used to parse the number.
  is_signed: True if a signed integer must be parsed.
  is_long: True if a long integer must be parsed.

Returns:
  The integer parsed.

Raises:
  ParseError: If an integer with given characteristics couldn't be consumed.
r  N)r   r   r  r   r   r   )r   r  r  r<   r  r   r   r  r  e  sQ    ')//YPF 	- 
 '


s1v
&&'s   + AAAc                s    \        V 4      p\        ^\        V4      ,          \        V4      ,           ,          pVP                  V4       V# )zParses an integer.

Args:
  text: The text to parse.
  is_signed: True if a signed integer must be parsed.
  is_long: True if a long integer must be parsed.

Returns:
  The integer value.

Raises:
  ValueError: Thrown Iff the text is not a valid integer.
)r   _INTEGER_CHECKERSintZ
CheckValue)rC   r  r  r<   Zcheckerr   r   r   r   {  s?     !&& a#g,.Y?@'	V	-r   c                s    T p\         P                  ! RV 4      pV'       d/   VP                  ^4      R,           VP                  ^4      ,           p  \        V ^ 4      #   \         d    \	        RT,          4      hi ; i)zParses an integer without checking size/signedness.

Args:
  text: The text to parse.

Returns:
  The integer value.

Raises:
  ValueError: Thrown Iff the text is not a valid integer.
z(-?)0(\d+)$Z0ozCouldn't parse integer: %s)r  r   r   r  r  )rC   Z	orig_textZc_octal_matchr   r   r   r     sw     )((>40- q!D(=+>+>q+AAD@tQ<	 @
2Y>
??@s   A A;c                s    \        V 4      #   \         d    \        P                  T 4      '       d)   T ^ ,          R8X  d   \        R4      u # \        R4      u # \        P                  T 4      '       d   \        R4      u #  \        T P                  R4      4      u #   \         d    \        RT ,          4      hi ; ii ; i)zParse a floating point number.

Args:
  text: Text to parse.

Returns:
  The number parsed.

Raises:
  ValueError: If a floating point number couldn't be parsed.
Z-z-infZinfZnanfzCouldn't parse float: %s)Zfloatr  _FLOAT_INFINITYr   
_FLOAT_NANr/   rC   r   r   r  r    s    =;	 =T""	aCV}U|			$		5\=T[[%&& =4t;<<==s8   
 %CCCC6CB C B>>Cc                s<    V R9   d   R# V R9   d   R# \        R4      h)zParse a boolean value.

Args:
  text: Text to parse.

Returns:
  Boolean values parsed

Raises:
  ValueError: If text is not a valid boolean.
TFzExpected "true" or "false".)r   ZtZ1ZTrue)r   r  Z0ZFalse)r  r  r   r   r  r    s(     
''++
2
33r   c                s   V P                   p \        V^ 4      p\        V P                  R4      '       d   V P                  P                  R8X  d   V# VP
                  P                  VR4      pVf   \        RVP                  V3,          4      h VP                  #   \         dM    TP                  P                  TR4      pTf   \        RTP                  : RT: R24      h TP                  # i ; i)a  Parse an enum value.

The value can be specified by a number (the enum value), or by
a string literal (the enum name).

Args:
  field: Enum field descriptor.
  value: String value.

Returns:
  Enum value number.

Raises:
  ValueError: If the enum value could not be parsed.
r   r   Nz+Enum type "%s" has no value with number %d.zEnum type "z" has no value named r   )r   r  r   Zfiler   r   rA   r  ri   Zvalues_by_namerf   )rJ   rR   Zenum_descriptorrf   r   s   &&   r   r
  r
    s      OO/<]F uzz8$$			h	& 1155fdCJD'116:; < <  
		# 
 ; //33E4@J'115: ; ;  
		#;s   B A	C54C5)r=   r   r.   rP   rT   r   rD   )r  r   )FFFFFNNFNrd   NFFr   )rd   FFFFFNNNFFr   )FF)Ar
   Z
__author__Zencodings.raw_unicode_escapeZ	encodingsZencodings.unicode_escaper!   r   r  Zgoogle.protobuf.internalr    r   rV   r   r   Z__all__ZUint32ValueCheckerZInt32ValueCheckerZUint64ValueCheckerZInt64ValueCheckerr  r  Z
IGNORECASEr  r  Z	frozensetr	  rj   rv   r   r   Zobjectr    r=   rD   rK   r.   rP   rT   rX   rt   rs   r-   r   r   r   r   r   r   r   r   r   r   Z
_Tokenizerr   r   r   r   r   r   r  r   r   r  r  r
  r   r   r   <module>r      s  >
 0
 $  	  	 , 2 & )9 #557"446"557"4468  **12==AZZ"--0

J
+ 0I 0 .# #Od5 >#0(04   uv up	7=t#/L+D+DO.f O.d
!&.&@,Q4 Q4j
 
CDBC,.@2=@4($r   