package Ġcom . w ak az ta hir . code editor . prett ify . lang ĊĊ Ċ import Ġcom . w ak az ta hir . code editor . prett ify . parser . P rett ify Ċ import Ġcom . w ak az ta hir . code editor . prett ify . parser . Style Pattern Ċ import Ġcom . w ak az ta hir . code editor . utils . new Ċ Ċ class ĠLang Swift Ġ: ĠLang () Ġ{ ĊĊĊĠĠĠ Ġoverride Ġval Ġfall through Style Patterns Ġ= ĠArrayList < Style Pattern >() ĊĠĠĠ Ġoverride Ġval Ġshortcut Style Patterns Ġ= ĠArrayList < Style Pattern >() ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfile Extensions Ġ= ĠlistOf (" swift ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetFile Extensions (): ĠList < String > Ġ= Ġfile Extensions ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġshortcut Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ PLAIN , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ [ Ġ\\ n \\ r \\ t \\ v \\ u 0 0 0 c \\\ u 0 0 0 0 ]+ "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Ġ\\ n \\ r \\ t \\ v \\ u 0 0 0 c \\ 0 " ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġshortcut Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ STRING , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ \" (?: [^ \" \\\\ ] |( ?: \\\\ . )| (?: \\\\ \\ (( ?: [^ \" \\\\ )] | \\\\ . )* \\ ))) *\ "" ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"\"" ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ LITERAL , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ (?: (?: 0 x [ \\ da - fA - F ][ \\ da - fA - F _ ]* \\ .[ \\ da - fA - F ][ \\ da - fA - F _ ]* [ pP ]? )| (?: \\ d [ \\ d _ ]* \\. \\ d [ \\ d _ ]* [ e E ]? ))[ +- ]? \\ d [ \\ d _ ]* "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ LITERAL , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ - ?( ?: (?: 0 (?: (?: b [ 0 1 ][ 0 1 _ ]*) |( ?: o [ 0 - 7 ][ 0 - 7 _ ]*) |( ?: x [ \\ da - fA - F ][ \\ da - fA - F _ ]* ))) |( ?: \\ d [ \\ d _ ]* )) "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ LITERAL , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ (?: _| Any | true | false | nil )\\ b "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ KEYWORD , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ \\ b (?: __ COLUMN __| __ FILE __| __ FUNCTION __| __ LINE __| # available | # color Literal | # column | # else | # elseif | # endif | # file | # file Literal | # function | # if | # image Literal | # line | # selector | # source Location | arch | arm | arm 6 4 | associated type | associ ativity | as | break | case | catch | class | continue | con venience | default | defer | de init | did Set | do | dynamic | dynamic Type | else | enum | extension | fall through | file private | final | for | func | get | guard | import | indirect | infix | init | inout | internal | i 3 8 6 | if | in | iOS | iOS Application Extension | is | lazy | left | let | mut ating | none | non mut ating | open | operator | optional | OSX | OSX Application Extension | override | postfix | pre cedence | prefix | private | protocol | Protocol | public | repeat | required | re throws | return | right | safe | Self | self | set | static | struct | sub script | super | switch | throw | throws | try | Type | type alias | un owned | unsafe | var | weak | watch OS | where | while | will Set | x 8 6 _ 6 4 )\\ b "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ COMMENT , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ \\/ \\/ .*? [ \\ n \\ r ] "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ COMMENT , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ \\/ \\ *[ \\ s \\ S ]* ?( ?: \\ * \\/ |$ )"), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ PUN CT UATION , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ << = | <= | << | >> = | >= | >> | === | == | \\. \\. \\ .| && = | \\. \\ .< | !== | != | & = | ~ = | ~ | \\ (| \\ )| \\ [ | \\ ]| \\ { |} |@ | # |; | \\ .| , |: | \\ | \\ |= | \\ ? \\ ?| \\ | \\ || && | & \\ * | & \\ + | & -| & = | \\ += |- = | \\/ = | \\ *= | \\ ^ = | %= | \\ |= | -> |` | == | \\ + \\ + |-- | \\/ | \\ + | ! | \\ * |% |< | >| & | \\ || \\ ^ | \\ ? |= |- | _ "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġfall through Style Patterns . new ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠP rett ify . PR _ TYPE , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRegex ("^ \\ b (?: [@ _ ]? [ A - Z ]+ [ a - z ][ A - Za - z _$ @ 0 - 9 ]* | \\ w + _ t \\ b )"), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ) ĊĊĊĠĠĠ Ġ} Ċ }