Îk)(}fi=ñh_JQ‹eÀ•]nÂýÅ`Ì¡QŽœ Æ‡™²®YÌžÉâ¢Ï+q±îUXãnýÕäã�æ÷ê’rhóŸAáw¯“´ÀÑ¡#g„„W".6‹B¾C‡åÍ6
y‹Æn
±�Ð	Ü€q<ûT°
,ò—#Àû6¦P‡…6
„AþKL?4\3�û$°4Á6’Äò<j¡([ûÊž„¹C[ì¢À™|M¸ÿä1úBÖŒ°ý—›¹äöêÍ&ìä[±’Â£(*óš£ÒLµ=ë4+¦òlcëXÐáPhJ9pL§]ü\  €ÊÛ²ˆ7¶ìŸnÛööëÃOèÌicl_„:åº 9‹¡Ø´ùð¨žìÛ†wK¤.™¥z …"=éôPstCæ¡>´Ö9±Jãb:E¶üâ²Ç=¶ƒã>‹£zÃp‰0ŽR+ëm¡2ºB€0g;/ôç6àó6<†¦—½æP=nköªôYEœÅ´í6ÇË©ˆ­í]q””;‘¯HážÚÉKmè“´¥ïð£Ú|ß±þ—SÓß˜T.óï¬S…´ó6�\Ïo}! ãùšÿ�£±c¹Ç…_Ò;a¼wº¢Y­˜æ}mab¼k­rÞQC�‚“ºÖby[æzV&ðÆ!ÿé ¸·š|‚²‘í¬ô�ô\biT°õƒ*1nƒÔžY^�•.Ùh{–óç:u!PëU[¯6¯—Nø }ýQ¨ÔkƒŒp!ðä{ïNaûµ–D³’‡u,”=#¾Cî×Èmæma¢àÏ“Â4á]9µ‚û¾†­Âg�Ú«½”Â`!Ó+¸P÷…²ùNÿDÃ!öc¹éàoC%(KvI„N€Ð/Aþˆƒ‡A÷&¤mþÐ/Aþˆƒ‡A÷&¤mþc½"æ	\¸[}Ž˜"¦¯€nƒù–S4v"”¬6nÉÑj»‹º»[úœöçÌuç½ü¤_±¬ƒ¡Œ”öØ]Ý½ÑOÜƒ{;†\¥ - Bh`'üoeÎþ9Œ,´”‹�ýâëÙ® ‘aÛdígwÔ–„…áyl¬Ešrº»ÿÂ ˜öÈlÜˆ_…·™è¦|Ó.Á—� ãp�ˆ]•:þ†ÔMî�2½Î>+ÁÉÂ0yOÐ/Aþˆƒ‡A÷&¤mþ\à+í[©·uWÞé\�ÀÉ¿KÈ^ïý÷Ò�…Z‡¨�’-a®#¸†%Wuö4ØfˆÙ"õyÈâ+Áµr÷½Ã‡˜÷¼º�Zk�ëèP†0¼¬pbõ”†éÕõŠ~jý˜’¡Ó³¥ã>~ž àvËðžE…’q«U_ùØöÛW÷¦DâU�xÑ‡Ÿ°Pµ]‡nš‘ãÁïd¶	ñJÓUïáô¯I~_U;�CÝ	¥zÐÑ@Å§·GWß0ÿ-ÌöqýðîwÖ’J¾¿_ÖÕ§J—>–Å·²Íbž�ð³`À€ÆgÙ=zx‡évÄè¢m$Û+×ø¨ÿ¾xÚS]@s³y	i×E’)Ai…Ã|\Îëg¯zÙp»~Ð/Aþˆƒ‡A÷&¤mþÐ/Aþˆƒ‡A÷&¤mþ<)†˜^‡˜6L(ÔTç¢l¦‹iO"
òg×’ÖÜk2t=±š‹*R,Ò4êåOÐ/Aþˆƒ‡A÷&¤mþÐ/Aþˆƒ‡A÷&¤mþ»��SzÜ¤£”é‚'™‹†—¨ÖS¦ˆÔ÷yÁgÆê#oâv[¯HŒ	Î~-ÕL±Éú¦ð9íåB'cäŠÑ’W‰€ÃµwR¥éëÀÌX°¶RHžL¸ZZ^\âß5b;h§îö?§³4»)±�0Éeá°´ûÝC-äýç{8özG*�Àß\VÇ øßn_CwUë`³Je¨¢CðÆO_©Ø÷sW®†ƒÜøçÑ#³!Ùcd½\jn|Ñ3+*Onv‹Ânfs_þZÂéû6Ò¨“·»_4êŸSC¦Öï¯Þ³ò@}x÷5ˆrhqÖdqOúì›M:WXÊÍ$Þ÷˜O€ÈjM?sNó\5ï¥9(Ä\t�Ç ¯	 �\þÖ4X?wdðÊöº¨‚¢Er,¦õ´GP/‹ÿ`“ë\¨~ÉaíZ]mƒgH3œF(˜x¹O�¥4«¨'4qïÖø!²ÄF±LúAßWiŸ'Z<pó�éÞîé|=ƒoþùâÏUYG'ÉŽH’~™øý
YmšP�·oYºä]o€z0—ÌaËœ¾&ÀIa%5Ï�¦ÿŽ	wtb…ë×«õm±ÕL/v,]uêr=í»îC‚­Lüÿ'hû=ŽUŒâRÎ~‚ýy�z�@EÛ’>{EÛ)7èmfó�Ä×¼xŒ­¶êWILMèúI%ŠüLµ¨\ü}?¢Ð/Aþˆƒ‡A÷&¤mþî¦zü?<’õ7Ñlæ§­¢¤›çë¸ÖxÞ®Ì_ˆ¬BþÞë˜º`3°o)Pl‘Íaõh7¿p&�8pŠ,üáV×7§Œm ¡.ˆ¡(»¬²zê]èÄÂÃÚ™ƒX8Iiò3yZU'•	É68xÉÔ%öó¸¢îø	CW|�úÖÎ“õ…p"
È Ô�¨F²ªnB&ŽÔ½ðó/N$ÕszÖ‹ncEqïiî1ßå· yEv+óóòðkèã¦@/Œ¼9SÒ'icx
Ô4Ã§íásô2¼Úí*¢:Ð/Aþˆƒ‡A÷&¤mþÌó2ýLþœÇ¦¥*¢ã%ŠÁÿ;Ø	8¥î(õ¼™—©€¸~È`©�ÃÅˆòìßðu/Ÿ‡wðDâæx
µ ØÎ¨ÕüjÏ�"ÅT	§J„ÒÉ3€Ž¡ý8ÿo&zê]y·å£xÛa[šÔL OÒ'YïÝ¢ØsâœÒR÷ÞøÎ– “b)ñB—3ì©¦ç~åÉ4§}N”m
ãòrÏ<?²¼_<â'¨ú™*‡)¶œºZð#ò¿¾0cTrÂü=¸Öé ¨7FÔ…:¿&T×9ªÿ[U@/F‡Œz»{MóC[O‡N�Kø)€`Çeø8ÏÁ><G„ç|²†mýFxå�a¶.I
†áìÄCö›ÓÄüK°ÊSˆ_J�®dÅ{„ã�<T¿³47°q|U‚øŽv÷ÊEè]I^BÖ³“«Za°E\Í=7�
HÜÌà¦²ùk‘�¨ÃØCäön ,å¼±ÈÝÓIœ,ÉS¹ˆí¨À½Ö2F“¼Ëÿ\† ÿ’&ÃÙN–,Îº¼Ð¨9^A4äÜ£>2[Lç;Òh?ìÇ|ûg�ù 4n¯;ý'kZ{ÝZ™þK¥H{¾0Œ
QNûÉã{åáN@ÔU2�¥ÖÒIçKSÒË=âA\N°ÃÞÊþ;«Kø…‹´�¿ò”pØ¼]/®qdx@xa§m$ç�åE4 ÌµuW%ÉO¶`0�¶Ç³	0™€Aƒ™|ÎWÕqGMZžÙš�ïÛ4rf(Ðg:ËÝµØ�’ î€’:Ñ�’¤4ÁS@3Ï²E¤š	Ú~LTŸd†\ÏËF`kpmWËŽ©Aö6ƒÔs å±üÔYŸ´é“®¡[¨®ùø\),Ÿ–a2¨¡ó0àë&„”"»˜â×Û
ÙT¨‚zn®G¢D²"(„ÞËÇ’¹ÕÄŽ/>,ÏûzÜ{pe¨ÔÛ¢ª|Ï[DUî[‰§rú°½O 07º	T&L6yƒE¨d	D^®ä©²šH’as„û‡ûPà!ö–¸�™w˜ŠšS~žøc¾²mJdÃ×îpÄöÈN�¿¶¸{|ÿ¹w%d&!kˆ¼Xø_p,ZUš ~Å-Ó·™hûƒæ�°»6æË/Þn\`¦åõÈŸMŸ{á/Ù~™– NõsÅãgßß}yo#ñ®�àkÅØ½2Æ~·:±Œ³­ïÄr'®/ Œ¡œÂ°µÖØ<j*Ÿ@€RÅÈ™ª?ScÙ§l!• jšþm^ÒÊè4Šñå4ƒNÌÈÜ5ÝÆ½íS£Í×/ÎðŒõnõ¸W(Æk-<„á¨Q¬œ·Êñ"7—K_ÌOi¯“+À³s¡�•ºsÆ|,PŒBÓdcÎokM(h®àÍ-Æ¶¾JD_I÷”�
ãQ9�,ì7 ’Ñ˜Ó¾%nv(F{nfÁt”�9r =ƒ;ñÈ#ªAMÙzˆ;�—ùÁ–N[kOzjžAb:zLKŸŸ´êª·(–îÕ¯*©ì“ëoR�—hÉ(aò�ˆÄÂû„ÙSèù&k¹ª’ZÀ‚c…Ê?®²5ç[òCŒv&QÖ]=_Ä`o$K6�+_ÅO¢»0¸×Io+¼q�bN. bÏqµ’ƒ|Å(€kSãInqÑ£A¶:6Ñ¾“ºYã„5 C¯A²B.Ùº’ÜPnC¼È;~L¸æˆüpx·òl¦¥H2.¡ÕJø‘lVš(–P£KO!s§wô0kÖº`a­�.ò±HÑ];xC¿ÕM›˜Ç?~.÷¿OÐ/Aþˆƒ‡A÷&¤mþAÛ€°Þ›•"*àÆ?@GŒú°Ü†’ã{’N»Ño®Öû¢cn|Á1BYñ2ÍK38EÌ‰büR2¦›C#f‡ÑI"å>dl�§ã5úÄl#ö–¸*ßèÏl•3á{y�ºÌœjÎö~ºY«dÙ_ùäÅÉTÞÛt§ãžJÍáïÛý“ c}‹ía8å® aüLcúô_z€Ñ›?´:/9‹ª.#V?[íOré}gþÅ·U¢cn|Á1BYñ2ÍK38EÌ‰büR2¦›C#f‡ÑÇ9qQ–;új_Ú1�¼4tb÷½sh‡ÂÎ£¸‚Ô¯²zânöß„Ó÷¤ëÚ­Q¹Åæî~FXÆ :bL§G4®^ê&N¢wS¼“�OÆajìÆ`o$K6�+_ÅO¢»0(ˆq¨^k<þCí—ˆÈs¸Hä£¶µ-B\=b—ãyEhj¡õxUTd\ÇYC€ÖóP6'p*7‚%Ðº£ûß¾§¥{Ò�#1Üì0l·\¥7Í´
)¦`ÅßøàÚŸaû¹ÉzaXÏ!:¯û­Èÿ~
è[Ç;à;Sp'�iÉ¦¡Í¶Vúx}Ü&UÊGÆGû<àý>ýšëŒüZ]DÒkß?ï„HãÊÔ%ÀîÊçMKÍN„¶aìU2jñ7ªá@ãûZjñ+€#UÔÆì<"oAk\;];;6xRÅÃLR4?Õ±ÞÜ¨4äŽÏãÛ\VÑ¯QM^¶ë©—4w0W[ü¥ÁbÔó�:é¸Y¢jŸù1Þƒ¥%…ùÝŠ0Ñ‡ÄHE§¤td![s‰S1’@üÙ 8cÚ›ÆÅ«
ªFþ<wý¹:0š�çF�€E‘~"-� (	#>›ð�QÚö:‚¢2Üø@"F§iû;©tring from the buffer that introduces a section.  The result is
   a symbol representing the kind of section.

   This allows us to treat (for the purposes of font-lock) several different
   section names as the same kind of section. For example, a 'sources section
   can be introduced by the 'sources', 'inputs', 'outputs' keyword.

   'other is the default section kind when a more specific match is not made."
  (cond ((string-match-p gyp-dependencies-regexp section) 'dependencies)
        ((string-match-p gyp-sources-regexp section) 'sources)
        ((string-match-p gyp-variables-regexp section) 'variables)
        ((string-match-p gyp-conditions-regexp section) 'conditions)
        ((string-match-p gyp-targets-regexp section) 'targets)
        ((string-match-p gyp-defines-regexp section) 'defines)
        (t 'other)))

(defun gyp-invalidate-parse-states-after (target-point)
  "Erase any parse information after target-point."
  (while (> (caar gyp-parse-history) target-point)
    (setq gyp-parse-history (cdr gyp-parse-history))))

(defun gyp-parse-point ()
  "The point of the last parse state added by gyp-parse-to."
  (caar gyp-parse-history))

(defun gyp-parse-sections ()
  "A list of section symbols holding at the last parse state point."
  (cdar gyp-parse-history))

(defun gyp-inside-dictionary-p ()
  "Predicate returning true if the parser is inside a dictionary."
  (not (eq (cadar gyp-parse-history) 'list)))

(defun gyp-add-parse-history (point sections)
  "Add parse state SECTIONS to the parse history at POINT so that parsing can be
   resumed instantly."
  (while (>= (caar gyp-parse-history) point)
    (setq gyp-parse-history (cdr gyp-parse-history)))
  (setq gyp-parse-history (cons (cons point sections) gyp-parse-history)))

(defun gyp-parse-to (target-point)
  "Parses from (point) to TARGET-POINT adding the parse state information to
   gyp-parse-state-history. Parsing stops if TARGET-POINT is reached or if a
   string literal has been parsed. Returns nil if no further parsing can be
   done, otherwise returns the position of the start of a parsed string, leaving
   the point at the end of the string."
  (let ((parsing t)
        string-start)
    (while parsing
      (setq string-start nil)
      ;; Parse up to a character that starts a sexp, or if the nesting
      ;; level decreases.
      (let ((state (parse-partial-sexp (gyp-parse-point)
                                       target-point
                                       -1
                                       t))
            (sections (gyp-parse-sections)))
        (if (= (nth 0 state) -1)
            (setq sections (cdr sections)) ; pop out a level
          (cond ((looking-at-p "['\"]") ; a string
                 (setq string-start (point))
                 (goto-char (scan-sexps (point) 1))
                 (if (gyp-inside-dictionary-p)
                     ;; Look for sections inside a dictionary
                     (let ((section (gyp-section-name
                                     (buffer-substring-no-properties
                                      (+ 1 string-start)
                                      (- (point) 1)))))
                       (setq sections (cons section (cdr sections)))))
                 ;; Stop after the string so it can be fontified.
                 (setq target-point (point)))
                ((looking-at-p "{")
                 ;; Inside a dictionary. Increase nesting.
                 (forward-char 1)
                 (setq sections (cons 'unknown sections)))
                ((looking-at-p "\\[")
                 ;; Inside a list. Increase nesting
                 (forward-char 1)
                 (setq sections (cons 'list sections)))
                ((not (eobp))
                 ;; other
                 (forward-char 1))))
        (gyp-add-parse-history (point) sections)
        (setq parsing (< (point) target-point))))
    string-start))

(defun gyp-section-at-point ()
  "Transform the last parse state, which is a list of nested sections and return
   the section symbol that should be used to determine font-lock information for
   the string. Can return nil indicating the string should not have any attached
   section."
  (let ((sections (gyp-parse-sections)))
    (cond
     ((eq (car sections) 'conditions)
      ;; conditions can occur in a variables section, but we still want to
      ;; highlight it as a keyword.
      nil)
     ((and (eq (car sections) 'list)
           (eq (cadr sections) 'list))
      ;; conditions and sources can have items in [[ ]]
      (caddr sections))
     (t (cadr sections)))))

(defun gyp-section-match (limit)
  "Parse from (point) to LIMIT returning by means of match data what was
   matched. The group of the match indicates what style font-lock should apply.
   See also `gyp-add-font-lock-keywords'."
  (gyp-invalidate-parse-states-after (point))
  (let ((group nil)
        (string-start t))
    (while (and (< (point) limit)
                (not group)
                string-start)
      (setq string-start (gyp-parse-to limit))
      (if string-start
          (setq group (cl-case (gyp-section-at-point)
                        ('dependencies 1)
                        ('variables 2)
                        ('conditions 2)
                        ('sources 3)
                        ('defines 4)
                        (nil nil)))))
    (if group
        (progn
          ;; Set the match data to indicate to the font-lock mechanism the
          ;; highlighting to be performed.
          (set-match-data (append (list string-start (point))
                                  (make-list (* (1- group) 2) nil)
                                  (list (1+ string-start) (1- (point)))))
          t))))

;;; Please see http://code.google.com/p/gyp/wiki/GypLanguageSpecification for
;;; canonical list of keywords.
(defun gyp-add-font-lock-keywords ()
  "Add gyp-mode keywords to font-lock mechanism."
  ;; TODO(jknotten): Move all the keyword highlighting into gyp-section-match
  ;; so that we can do the font-locking in a single font-lock pass.
  (font-lock-add-keywords
   nil
   (list
    ;; Top-level keywords
    (list (concat "['\"]\\("
              (regexp-opt (list "action" "action_name" "actions" "cflags"
                                "cflags_cc" "conditions" "configurations"
                                "copies" "defines" "dependencies" "destination"
                                "direct_dependent_settings"
                                "export_dependent_settings" "extension" "files"
                                "include_dirs" "includes" "inputs" "ldflags" "libraries"
                                "link_settings" "mac_bundle" "message"
                                "msvs_external_rule" "outputs" "product_name"
                                "process_outputs_as_sources" "rules" "rule_name"
                                "sources" "suppress_wildcard"
                                "target_conditions" "target_defaults"
                                "target_defines" "target_name" "toolsets"
                                "targets" "type" "variables" "xcode_settings"))
              "[!/+=]?\\)") 1 'font-lock-keyword-face t)
    ;; Type of target
    (list (concat "['\"]\\("
              (regexp-opt (list "loadable_module" "static_library"
                                "shared_library" "executable" "none"))
              "\\)") 1 'font-lock-type-face t)
    (list "\\(?:target\\|action\\)_name['\"]\\s-*:\\s-*['\"]\\([^ '\"]*\\)" 1
          'font-lock-function-name-face t)
    (list 'gyp-section-match
          (list 1 'font-lock-function-name-face t t) ; dependencies
          (list 2 'font-lock-variable-name-face t t) ; variables, conditions
          (list 3 'font-lock-constant-face t t) ; sources
          (list 4 'font-lock-preprocessor-face t t)) ; preprocessor
    ;; Variable expansion
    (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t)
    ;; Command expansion
    (list "<!@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t)
    )))

(provide 'gyp)
