| OLD | NEW |
| (Empty) | |
| 1 " Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 " Use of this source code is governed by a BSD-style license that can be |
| 3 " found in the LICENSE file. |
| 4 " |
| 5 " gn.vim: Vim syntax file for GN. |
| 6 " |
| 7 " Quit when a (custom) syntax file was already loaded |
| 8 "if exists("b:current_syntax") |
| 9 "finish |
| 10 "endif |
| 11 |
| 12 syn case match |
| 13 |
| 14 " Keywords within functions |
| 15 syn keyword gnConditional if else |
| 16 hi def link gnConditional Conditional |
| 17 |
| 18 " Predefined variables |
| 19 syn keyword gnPredefVar build_cpu_arch build_os cpu_arch current_toolchain |
| 20 syn keyword gnPredefVar default_toolchain os python_path root_build_dir |
| 21 syn keyword gnPredefVar root_gen_dir root_out_dir target_gen_dir |
| 22 syn keyword gnPredefVar target_out_dir |
| 23 syn keyword gnPredefVar true false |
| 24 hi def link gnPredefVar Constant |
| 25 |
| 26 " Target declarations |
| 27 syn keyword gnTarget action action_foreach copy executable group |
| 28 syn keyword gnTarget shared_library source_set static_library |
| 29 hi def link gnTarget Type |
| 30 |
| 31 " Buildfile functions |
| 32 syn keyword gnFunctions assert config declare_args defined exec_script |
| 33 syn keyword gnFunctions foreach get_label_info get_path_info |
| 34 syn keyword gnFunctions get_target_outputs getenv import print |
| 35 syn keyword gnFunctions process_file_template read_file rebase_path |
| 36 syn keyword gnFunctions set_default_toolchain set_defaults |
| 37 syn keyword gnFunctions set_sources_assignment_filter template tool |
| 38 syn keyword gnFunctions toolchain toolchain_args write_file |
| 39 hi def link gnFunctions Macro |
| 40 |
| 41 " Variables |
| 42 syn keyword gnVariable all_dependent_configs allow_circular_includes_from |
| 43 syn keyword gnVariable args cflags cflags_c cflags_cc cflags_objc |
| 44 syn keyword gnVariable cflags_objcc check_includes complete_static_lib |
| 45 syn keyword gnVariable configs data data_deps defines depfile deps |
| 46 syn keyword gnVariable forward_dependent_configs_from include_dirs inputs |
| 47 syn keyword gnVariable ldflags lib_dirs libs output_extension output_name |
| 48 syn keyword gnVariable outputs public public_configs public_deps script |
| 49 syn keyword gnVariable sources testonly visibility |
| 50 hi def link gnVariable Keyword |
| 51 |
| 52 " Strings |
| 53 syn region gnString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spe
ll |
| 54 hi def link gnString String |
| 55 |
| 56 " Comments |
| 57 syn keyword gnTodo contained TODO FIXME XXX BUG NOTE |
| 58 syn cluster gnCommentGroup contains=gnTodo |
| 59 syn region gnComment start="#" end="$" contains=@gnCommentGroup,@
Spell |
| 60 |
| 61 hi def link gnComment Comment |
| 62 hi def link gnTodo Todo |
| 63 |
| 64 " Operators; I think this is a bit too colourful. |
| 65 "syn match gnOperator /=/ |
| 66 "syn match gnOperator /!=/ |
| 67 "syn match gnOperator />=/ |
| 68 "syn match gnOperator /<=/ |
| 69 "syn match gnOperator /==/ |
| 70 "syn match gnOperator /+=/ |
| 71 "syn match gnOperator /-=/ |
| 72 "syn match gnOperator /\s>\s/ |
| 73 "syn match gnOperator /\s<\s/ |
| 74 "syn match gnOperator /\s+\s/ |
| 75 "syn match gnOperator /\s-\s/ |
| 76 "hi def link gnOperator Operator |
| 77 |
| 78 syn sync minlines=500 |
| 79 |
| 80 let b:current_syntax = "gn" |
| OLD | NEW |