YBFjidZddlmZmZmZmZmZddlmZm Z m Z m Z m Z m Z mZmZmZgdZGddeZGddeZGd d eZGd d eZGd deZdS)z pygments.lexers.data ~~~~~~~~~~~~~~~~~~~~ Lexers for data file format. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. )LexerExtendedRegexLexer LexerContextincludebygroups) CommentErrorKeywordLiteralNameNumber PunctuationString Whitespace) YamlLexer JsonLexerJsonBareObjectLexer JsonLdLexerc"eZdZdZfdZxZS)YamlLexerContextz'Indentation context for the YAML lexer.crtj|i|g|_d|_d|_d|_dSNr)super__init__ indent_stackindent next_indentblock_scalar_indent)selfargskwds __class__s BC:\PYTHON\_runtimes\venv\Lib\site-packages\pygments/lexers/data.pyrzYamlLexerContext.__init__sD$'$''' #'   )__name__ __module__ __qualname____doc__r __classcell__r#s@r$rrs>11(((((((((r%rc eZdZdZdZdZdgZddgZdgZdZ d Z d Z ded Z ded Z dZdZdZdZiddefdefdejfde ejdfde ejdfde ejdfde eddfgd defdejfd!ed"fgdd#eeed fgdd$eeejeejd fgd%d&e ed"fd'e efd(e ejfd)e ed*fgdd+e ed*fd,efd-eeje ed.fed/ed0ed1d2e ejd3fgd/d4ejfd5ejfd6ej fd7ejfgd0d8e ejd.fd9ejd:fgd1d;ejdfd?e!d@fdAe!dBfgdCd,efdefdejfdDejfed/ed1dEe ejdFfgd<edCdGejd*fgd>dHeejefedCdIejd*fgdJd!efdKeeej"fdLeefdMej"fgdNdOeejd fdPeejd fgdQdRefdSefdefd,ejfgd@edQdTe!j#fdUe!fd?e!d*fgdBedQdVe!fdWe!j#fdXe!fdYe!d*fgdKefdefdZe ejd[fdLeed*fgd\e ed*fd]ed*fdSefded^fd,e$j%j&fd_e$j%j&fgd`e ed*fd]ed*fdRefdSefdefd,ejfdaejfgdbZ'dffdd Z(xZ)S)grzK Lexer for YAML, a human-friendly data serialization language. YAMLzhttp://yaml.org/yamlz*.yamlz*.ymlz text/x-yamlz0.11cfd}|S)zDo not produce empty tokens.c3K|}|sdS||fV||_dSN)groupstartendposlexermatchcontexttext token_classs r$callbackz%YamlLexer.something..callback-sO;;==D ++--d2 2 2 2))++GKKKr%r;r<s` r$ somethingzYamlLexer.something+s# & & & & & r%cfd}|S)zReset the indentation levels.c3K|}g|_d|_d|_d|_||fV||_dSr)r2rrrrr3r4r5r6s r$r<z(YamlLexer.reset_indent..callback7sa;;==D#%G GN"#G *.G '++--d2 2 2 2))++GKKKr%r=r>s` r$ reset_indentzYamlLexer.reset_indent5s# & & & & &r%Fcfd}|S)z"Save a possible indentation level.c3`K|}d}rt||_|j|jkrl|j|jkr.|j|_|j|jk.|j|jkr||jd}|d|j}n|xjt|z c_|r||fV|r.|t|zj|fV||_ dS)N) r2lenrrrpopr3r r4r5)r7r8r9r:extrar3r;s r$r<z'YamlLexer.save_indent..callbackCs*;;==DE 1&)$ii#&77!->>)0)=)A)A)C)C"->>*W^;; $W^__ 5#OW^O4##s4yy0## 7kkmm[$6666 HkkmmCII-{/@%GGGG))++GKKKr%r=)r;r3r<s`` r$ save_indentzYamlLexer.save_indentAs) & & & & & &$r%cfd}|S)z+Set the previously saved indentation level.c3LK|}|j|jkr+|j|j|j|_s|xjt |z c_||fV||_dSr1) r2rrrappendrFr3r4r5)r7r8r9r:implicitr;s r$r<z&YamlLexer.set_indent..callbackYs;;==D~ 333$++GN;;;!(!4 1##s4yy0##++--d2 2 2 2))++GKKKr%r=)r;rMr<s`` r$ set_indentzYamlLexer.set_indentWs) & & & & & &r%cfd}|S)z5Set an explicit indentation level for a block scalar.c3@K|}d|_|sdS|d}|r.t|jd}t |}||z|_|r4||fV||_dSdS)Nr)r2rmaxrintr3r4r5)r7r8r9r: incrementcurrent_indentr;s r$r<z3YamlLexer.set_block_scalar_indent..callbackfs;;==D*.G '  AI I!$W^Q!7!7 NN .s` r$set_block_scalar_indentz!YamlLexer.set_block_scalar_indentds# * * * * *r%cfd}|S)z(Process an empty line in a block scalar.c3K|}|jt||jkr|r||fVnX|d|j}||jd}||fV||jz|fV||_dSr1)r2rrFr3r4r5)r7r8r9r: indentationcontentcontent_token_classindent_token_classs r$r<z9YamlLexer.parse_block_scalar_empty_line..callbackws;;==D+3II!<<<B++--);TAAAA"#?G$?#?@ w:;;<kkmm%7DDDD{{}}W%@@*G5555))++GKKKr%r=)r\r[r<s`` r$parse_block_scalar_empty_linez'YamlLexer.parse_block_scalar_empty_lineus) & & & & & &r%cfd}|S)z-Process indentation spaces in a block scalar.c3$K|}|jot|t|jdkr4|j|jdSt||_nLt||jkr4|j|jdS|r4||fV||_ dSdSNr) r2rrFrRrstackrGr3r4r5r6s r$r<z5YamlLexer.parse_block_scalar_indent..callbacks;;==D*2t99GNA 6 666M%%'''M%%'''F.1$ii++t99w:::M%%'''M%%'''F *kkmm[$6666#iikk  * *r%r=r>s` r$parse_block_scalar_indentz#YamlLexer.parse_block_scalar_indents# * * * * * r%cfd}|S)z-Process indentation spaces in a plain scalar.c38K|}t||jkr4|j|jdS|r4||fV||_dSdSr1)r2rFrrarGr3r4r5r6s r$r<z5YamlLexer.parse_plain_scalar_indent..callbacks;;==D4yyGN** !!### !!### *kkmm[$6666#iikk  * *r%r=r>s` r$parse_plain_scalar_indentz#YamlLexer.parse_plain_scalar_indents# * * * * *r%rootz [ ]+(?=#|$)z\n+z#[^\n]*z^%YAML(?=[ ]|$)zyaml-directivez^%TAG(?=[ ]|$)z tag-directivez^(?:---|\.\.\.)(?=[ ]|$) block-linez [ ]*(?!\s|$)T)r3)rgrYz ignored-linez\nz#pop:2z([ ]+)([0-9]+\.[0-9]+)z;([ ]+)(!|![\w-]*!)([ ]+)(!|!?[\w;/?:@&=+$,.!~*\'()\[\]%-]+)rYz[ ]*$z[ ]+(?=[?:-](?:[ ]|$))z[?:-](?=[ ]|$)z[ ]*z#popz [ ]*(?=#|$)z[ ]+z([^#,?\[\]{}"'\n]+)(:)(?=[ ]|$))rM descriptorsz block-nodesz flow-nodesz'(?=[^\s?:,\[\]{}#&*!|>\'"%@`-]|[?:-]\S)plain-scalar-in-block-contextz!!<[\w#;/?:@&=+$,.!~*\'()\[\]%-]+>z+!(?:[\w-]+!)?[\w#;/?:@&=+$,.!~*\'()\[\]%-]*z&[\w-]+z\*[\w-]+z :(?=[ ]|$)z[|>])block-scalar-contentblock-scalar-headerz\[z flow-sequencez\{z flow-mappingz\'zsingle-quoted-scalarz\"zdouble-quoted-scalarzflow-collectionz[?:,]z(?=[^\s?:,\[\]{}#&*!|>\'"%@`])plain-scalar-in-flow-contextz\]z([^,:?\[\]{}"'\n]+)(:)(?=[ ]|$)z\}rjz^[ ]+$z^[ ]*z[\S\t ]+rkz([1-9])?[+-]?(?=[ ]|$)z[+-]?([1-9])?(?=[ ]|$)zquoted-scalar-whitespacesz^[ ]+z[ ]+$z\'\'z[^\s\']+z\\[0abt\tn\nvfre "\\N_LP]z5\\(?:x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})z [^\s"\\]+"z^(?=---|\.\.\.)z#pop:3z[ ]*(?=:[ ]|:$)z [ ]+(?=#)&plain-scalar-in-block-context-new-linez(?::(?!\s)|[^\s:])+z[ ]*(?=[,:?\[\]{}])z[^\s,:?\[\]{}]+)rnrirlNcl|t|d}t||Sr`)rrget_tokens_unprocessed)r r:r9r#s r$rpz YamlLexer.get_tokens_unprocesseds1 ?&tQ//Gww--dG<< ; AEN : Xj', GL I I   OE`  yy,,h 7 & J(?(? @  ;+@ A A B kk*--v 6  aEx  YYz22F ; j ! 3 Xdh ; F F F G G I GM " " GM " " GL ! ! 7 Yt} % % , . yEb  17< @/07  > $ $- (  cE|  JJ{'  }EN  K)? ; K)> : F2 3 F2 3  OEf  j ! Z  ( {, - GM " " GL ! ! . Yt} % % + - gEN  G% & & K)6 2  OE^  3 Xdh , , . G% & & K)6 2 _Et  J   * *:t} E E G00<< = $- ( ! uEN  & $ $[%: ; ;  ' $ $[%: ; ;   OEf $ z " z " Z dm $& gE|  G/ 0 0 fm $ & ! FF # ! }ET  G/ 0 0 )6 2 E ] 6 " 66 " ! UEv # Z 4>!:!:H E 00<    c #, Kd}d}d}d}d}d}d}d} d} d} d} d} d}g}t|D]p\}}|rk|r||jvr |dz}|sd}nUd}d}nP|r |dkrd}nEd}nB|dkrd}n9|dkr3||tj|||dzfd}d}d}s|rJ||jvr|r&||t |||fn|t |||fVd}n|r'||jvr|tj |||fVd}ny|rR||j vr||j vrd}|r|tj |||fVn|tj|||fVd}d}n%| r#||jvrI|t |||fVd} n| rQ|d krk|r+||t"j|||fn|t"j|||fVd} n| rc|d krd} nX| rVd} |d krN|r.||t"j|||dzfn|t"j|||dzfVd} | rFd} |d krd} '|d krd} 1|Ed {V||t*|||fV|}|dkrd}m||jvrd}z|d vr |Ed {V|d}||j vr |Ed {V|d}|dkrH|D]-\}}}|tjur|t,j|fV&|||fV.|d} ||jvr |Ed {V|d} >|d krd} H|Ed {V||t*|fVr|Ed {V|r|t*||d fVd S|r|tj ||d fVd S|r|tj||d fVd S|r|tj ||d fVd S|r|t ||d fVd S| r|t ||d fVd S| r|t"j||d fVd S| r|t*||d fVd S| r|t*||d fVd Sd S)zParse JSON data.FrrQu\Trmr*/N>fnt:) enumerate hexadecimalsrLrDouble whitespacesr constantsr r~integersfloatsr FloatInteger punctuationsrrrw Multilineclearr r rx)r r: in_string in_escapein_unicode_escape in_whitespace in_constant in_numberin_floatin_punctuationin_comment_singlein_comment_multilineexpecting_second_comment_openerexpecting_second_comment_closerr3queuestop character_start_token_texts r$rpz JsonLexer.get_tokens_unprocessedsV     !$*/'*/'((j .j .OD)m 5$* D$555)Q.)0.(-I,-)$)  * C'',-))$) $&& $II#%%LL%U4!8^8L!MNNN %I %I()%R 5 000>LL%T%*5E!FGGGGT%*-===== % G 5..W-tE$J/?????# ? 5 --$+--#HBtE$J/??????eDj1AAAAA!   0 5 111[$uTz*:::::!&#( 5$$BLL%eDj9I!JKKKKeDj1AAAAA$)!!& 5##6:33456;3 C'' Q!LL%1BDtVWxDX)YZZZZ"'):DtaxzJsonLdLexer.s0  Wr%)base containerr9 directiongraphidimportincludedindexrlanguagelistnestnoneprefix propagate protectedreversertypevalueversionvocabc#Kt|D]6\}}}|tjur||jvr|tj|fV/|||fV7dSr1)rrpr rxjson_ld_keywords Decorator)r r:r3tokenrr#s r$rpz"JsonLdLexer.get_tokens_unprocesseds#(77#A#A$#G#G * * E5%  Ud.C%C%CT^U22222UE)))))  * *r%) r&r'r(r)rqrrrsrtrurvrrpr*r+s@r$rrs D C#G I&'IM :*********r%rN)r)pygments.lexerrrrrrpygments.tokenrr r r r r rrr__all__rrrrrr=r%r$rs$$$$$$$$$$$$$$$$$$$$$$ K J J(((((|(((S=S=S=S=S="S=S=S=l F-F-F-F-F-F-F-F-R     )    .*.*.*.*.*).*.*.*.*.*r%