3
T'íc»7 ã @ sÒ d Z ddlZddlmZ ddlmZmZmZmZm Z m
Z
mZmZ ddl
mZ ddlmZ ddlmZ ddlmZ dd lmZ ejeZeegef Zejd
ZejdZejdZejd
Z ejdZ!ejdZ"ejdZ#ejdZ$ejdZ%ejdZ&ejdZ'eddddZ(G dd de)Z*G dd dZ+G dd de+Z,G dd de,Z-G d d! d!e+Z.G d"d# d#e,Z/G d$d% d%e,Z0G d&d' d'e,Z1G d(d) d)e+Z2G d*d+ d+e)Z3G d,d- d-e)Z4G d.d/ d/Z5dS )0z2Utility functions common to the C and C++ domains.é N)Údeepcopy)ÚAnyÚCallableÚListÚMatchÚOptionalÚPatternÚTupleÚUnion)Únodes)ÚTextElement)Úaddnodes)ÚConfig)Úloggingz(?u)\s+z(@[a-zA-Z0-9_])[a-zA-Z0-9_]*\ba
(?x)
( # This 'extends' _anon_identifier_re with the ordinary identifiers,
# make sure they are in sync.
(~?\b[a-zA-Z_]) # ordinary identifiers
| (@[a-zA-Z0-9_]) # our extension for names of anonymous entities
)
[a-zA-Z0-9_]*\b
z[1-9][0-9]*(\'[0-9]+)*z0[0-7]*(\'[0-7]+)*z"0[xX][0-9a-fA-F]+(\'[0-9a-fA-F]+)*z0[bB][01]+(\'[01]+)*a% (?x)
# unsigned and/or (long) long, in any order, but at least one of them
(
([uU] ([lL] | (ll) | (LL))?)
|
(([lL] | (ll) | (LL)) [uU]?)
)\b
# the ending word boundary is important for distinguishing
# between suffixes and UDLs in C++
a (?x)
[+-]?(
# decimal
([0-9]+(\'[0-9]+)*[eE][+-]?[0-9]+(\'[0-9]+)*)
| (([0-9]+(\'[0-9]+)*)?\.[0-9]+(\'[0-9]+)*([eE][+-]?[0-9]+(\'[0-9]+)*)?)
| ([0-9]+(\'[0-9]+)*\.([eE][+-]?[0-9]+(\'[0-9]+)*)?)
# hex
| (0[xX][0-9a-fA-F]+(\'[0-9a-fA-F]+)*[pP][+-]?[0-9a-fA-F]+(\'[0-9a-fA-F]+)*)
| (0[xX]([0-9a-fA-F]+(\'[0-9a-fA-F]+)*)?\.
[0-9a-fA-F]+(\'[0-9a-fA-F]+)*([pP][+-]?[0-9a-fA-F]+(\'[0-9a-fA-F]+)*)?)
| (0[xX][0-9a-fA-F]+(\'[0-9a-fA-F]+)*\.([pP][+-]?[0-9a-fA-F]+(\'[0-9a-fA-F]+)*)?)
)
z[fFlL]\bzÒ(?x)
((?:u8)|u|U|L)?
'(
(?:[^\\'])
| (\\(
(?:['"?\\abfnrtv])
| (?:[0-7]{1,3})
| (?:x[0-9a-fA-F]{2})
| (?:u[0-9a-fA-F]{4})
| (?:U[0-9a-fA-F]{8})
))
)'
)ÚmodeÚreturnc C s | dkrt d| d S ) NÚ
lastIsNameÚ
noneIsNameÚmarkTypeÚmarkNameÚparamÚudlz!Description mode '%s' is invalid.)r r r r r r )Ú Exception)r © r ú5/tmp/pip-build-gk9425m9/sphinx/sphinx/util/cfamily.pyÚverify_description_modeI s r c @ s e Zd ZdS )ÚNoOldIdErrorN)Ú__name__Ú
__module__Ú__qualname__r r r r r N s r c @ sv e Zd ZU eedddZdZeg ef edddZ e
edd d
ZedddZ
edd
dZedddZdS )ÚASTBaseBase)Úotherr c C s\ t | t |k rdS y.x(| jj D ]\}}|t||kr"dS q"W W n tk
rV dS X dS )NFT)ÚtypeÚ__dict__ÚitemsÚgetattrÚAttributeError)Úselfr! ÚkeyÚvaluer r r Ú__eq__T s zASTBaseBase.__eq__N)r c C s t | S )N)r )r'