"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/yaml.lang" (12 May 2020, 6133 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "yaml.lang": 3.53_vs_3.54.

    1 Description="Ansible YAML"
    2 
    3 -- Syntax file created by Raphael Droz
    4 
    5 Categories = {"markup"}
    6 
    7 --Identifiers=[[ ([\w][\S]+?\:) ]]
    8 
    9 Identifiers=[[ ("?[\w][\S]+?\"?:) ]]
   10 
   11 Digits = [[ [\W](\d*[\.]?\d+(?:[eE][\-\+]\d+)?)(?![\w]) ]]
   12 
   13 Keywords={
   14   {
   15   Id=1,
   16     List={ },  -- see OnStateChange comment
   17   },
   18   {
   19   Id=2,
   20     List={
   21       -- /usr/share/pyshared/ansible/playbook/task.py
   22       'action', 'always_run', 'any_errors_fatal', 'args', 'become', 'become_method', 'become_pass',
   23       'become_user', 'changed_when', 'delay', 'delegate_to', 'environment', 'failed_when',
   24       'first_available_file', 'ignore_errors', 'local_action', 'meta', 'name', 'no_log',
   25       'notify', 'register', 'remote_user', 'retries', 'run_once', 'su', 'su_pass', 'su_user',
   26       'sudo', 'sudo_pass', 'sudo_user', 'tags', 'transport', 'until', 'when',
   27     },
   28   },
   29 
   30   { Id=3,
   31     List={
   32       -- /usr/share/pyshared/ansible/playbook/play.py
   33       'accelerate', 'accelerate_ipv6', 'accelerate_port',
   34       'force_handlers', 'gather_facts',
   35       'handlers', 'hosts', 'roles', 'serial',
   36       'vars', 'vars_files', 'vars_prompt',
   37       'vault_password',
   38 
   39       '_ds', '_handlers', '_play_hosts', '_tasks', 'basedir',
   40           'default_vars', 'included_roles', 'max_fail_pct', 'playbook', 'remote_port',
   41           'role_vars', 'vars_file_vars',
   42 
   43           'connection', 'include', 'max_fail_percentage', 'port', 'post_tasks',
   44           'pre_tasks', 'role_names', 'tasks', 'user',
   45 
   46       'role', -- not listed explicitely
   47 
   48       -- find /usr/share/pyshared/ansible/modules/ -name '*.py' -printf "%f\n"|cut -d. -f1|sed 's;$;:;'|sort -u
   49 
   50         "a10_server", "a10_service_group", "a10_virtual_server", "accelerate", "acl", "add_host", "airbrake_deployment", "alternatives", "apache2_module",
   51         "apt", "apt_key", "apt_repository", "apt_rpm", "assemble", "assert", "async_status", "async_wrapper", "at", "authorized_key", "azure", "bigip_facts",
   52         "bigip_monitor_http", "bigip_monitor_tcp", "bigip_node", "bigip_pool", "bigip_pool_member", "bigpanda", "boundary_meter", "bower", "bzr", "campfire",
   53         "capabilities", "cloudformation", "command", "composer", "copy", "cpanm", "cron", "crypttab", "datadog_event", "debconf", "debug", "digital_ocean",
   54         "digital_ocean_domain", "digital_ocean_sshkey", "django_manage", "dnf", "dnsimple", "dnsmadeeasy", "docker", "docker_image", "easy_install", "ec2",
   55         "ec2_ami", "ec2_ami_search", "ec2_asg", "ec2_eip", "ec2_elb", "ec2_elb_lb", "ec2_facts", "ec2_group", "ec2_key", "ec2_lc", "ec2_metric_alarm",
   56         "ec2_scaling_policy", "ec2_snapshot", "ec2_tag", "ec2_vol", "ec2_vpc", "ejabberd_user", "elasticache", "facter", "fail", "fetch", "file", "filesystem",
   57         "fireball", "firewalld", "flowdock", "gce", "gce_img", "gce_lb", "gce_net", "gce_pd", "gc_storage", "gem", "getent", "get_url", "git", "github_hooks",
   58         "glance_image", "gluster_volume", "group", "group_by", "grove", "haproxy", "hg", "hipchat", "homebrew", "homebrew_cask", "homebrew_tap", "hostname",
   59         "htpasswd", "include_vars", "ini_file", "irc", "jabber", "jboss", "jira", "kernel_blacklist", "keystone_user", "known_hosts", "layman",
   60         "librato_annotation", "lineinfile", "linode", "lldp", "locale_gen", "logentries", "lvg", "lvol", "lxc_container", "macports", "mail", "modprobe",
   61         "mongodb_user", "monit", "mount", "mqtt", "mysql_db", "mysql_replication", "mysql_user", "mysql_variables", "nagios", "netscaler", "newrelic_deployment",
   62         "nexmo", "nova_compute", "nova_keypair", "npm", "ohai", "openbsd_pkg", "open_iscsi", "openvswitch_bridge", "openvswitch_port", "opkg", "osx_say", "ovirt",
   63         "pacman", "pagerduty", "patch", "pause", "ping", "pingdom", "pip", "pkg5", "pkg5_publisher", "pkgin", "pkgng", "pkgutil", "portage", "portinstall",
   64         "postgresql_db", "postgresql_ext", "postgresql_lang", "postgresql_privs", "postgresql_user", "quantum_floating_ip", "quantum_floating_ip_associate",
   65         "quantum_network", "quantum_router", "quantum_router_gateway", "quantum_router_interface", "quantum_subnet", "rabbitmq_parameter", "rabbitmq_plugin",
   66         "rabbitmq_policy", "rabbitmq_user", "rabbitmq_vhost", "raw", "rax", "rax_cbs", "rax_cbs_attachments", "rax_cdb", "rax_cdb_database", "rax_cdb_user",
   67         "rax_clb", "rax_clb_nodes", "rax_dns", "rax_dns_record", "rax_facts", "rax_files", "rax_files_objects", "rax_identity", "rax_keypair", "rax_meta",
   68         "rax_network", "rax_queue", "rax_scaling_group", "rax_scaling_policy", "rds", "rds_param_group", "rds_subnet_group", "redhat_subscription", "redis",
   69         "replace", "rhn_channel", "rhn_register", "riak", "rollbar_deployment", "route53", "rpm_key", "s3", "script", "seboolean", "selinux", "service",
   70         "set_fact", "setup", "shell", "slack", "slurp", "snmp_facts", "sns", "stackdriver", "stat", "subversion", "supervisorctl", "svc", "svr4pkg", "swdepot",
   71         "synchronize", "sysctl", "template", "twilio", "typetalk", "ufw", "unarchive", "uptimerobot", "uri", "urpmi", "user", "virt", "vsphere_guest", "wait_for",
   72         "win_chocolatey", "win_copy", "win_feature", "win_file", "win_get_url", "win_group", "win_msi", "win_ping", "win_service", "win_stat", "win_template",
   73         "win_updates", "win_user", "xattr", "yum", "zabbix_group", "zabbix_maintenance", "zfs", "zypper", "zypper_repository"
   74         },
   75   },
   76 
   77   -- command's parameter names
   78   { Id=4,
   79     Regex=[[([a-z0-9]+)=]],
   80   },
   81 }
   82 
   83 Strings={
   84   Delimiter=[["|']],
   85   Interpolation=[[ \{\{(.*?)\}\} ]],
   86 }
   87 
   88 Comments={
   89   { Block=false,
   90     Delimiter= { [[#]] },
   91   },
   92 }
   93 
   94 -- |or|and|not|true|false|yes|no -> keyword group
   95 Operators=[[\(|\)|\[|\]|<|>|\=|\-|\,|\&|\!|\*|\%|\+|\%|\||{|}]]
   96 
   97 IgnoreCase=true
   98 
   99 -- resolve issue with unknown identifiers ending with : (see empty kw group 1)
  100 -- keyword group cannot be returned, use the first one to highlight tokens which are not listed in group 2 or 3
  101 
  102 function OnStateChange(oldState, newState, token, kwgroup)
  103   if newState==HL_STANDARD and string.sub(token,-1)==":"
  104     and not Keywords[1].List[token] and not Keywords[2].List[token] then
  105     return HL_KEYWORD
  106   end
  107 
  108   return newState
  109 end