]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/puppet.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / puppet.js
1 /*! `puppet` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: Puppet
7 Author: Jose Molina Colmenero <gaudy41@gmail.com>
8 Website: https://puppet.com/docs
9 Category: config
10 */
11
12 function puppet(hljs) {
13 const PUPPET_KEYWORDS = {
14 keyword:
15 /* language keywords */
16 'and case default else elsif false if in import enherits node or true undef unless main settings $string ',
17 literal:
18 /* metaparameters */
19 'alias audit before loglevel noop require subscribe tag '
20 /* normal attributes */
21 + 'owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check '
22 + 'en_address ip_address realname command environment hour monute month monthday special target weekday '
23 + 'creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore '
24 + 'links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source '
25 + 'souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid '
26 + 'ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel '
27 + 'native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options '
28 + 'device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use '
29 + 'message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform '
30 + 'responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running '
31 + 'start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age '
32 + 'password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled '
33 + 'enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist '
34 + 'priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey '
35 + 'sslverify mounted',
36 built_in:
37 /* core facts */
38 'architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers '
39 + 'domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces '
40 + 'ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion '
41 + 'kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease '
42 + 'lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major '
43 + 'macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease '
44 + 'operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion '
45 + 'rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced '
46 + 'selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime '
47 + 'uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version'
48 };
49
50 const COMMENT = hljs.COMMENT('#', '$');
51
52 const IDENT_RE = '([A-Za-z_]|::)(\\w|::)*';
53
54 const TITLE = hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE });
55
56 const VARIABLE = {
57 className: 'variable',
58 begin: '\\$' + IDENT_RE
59 };
60
61 const STRING = {
62 className: 'string',
63 contains: [
64 hljs.BACKSLASH_ESCAPE,
65 VARIABLE
66 ],
67 variants: [
68 {
69 begin: /'/,
70 end: /'/
71 },
72 {
73 begin: /"/,
74 end: /"/
75 }
76 ]
77 };
78
79 return {
80 name: 'Puppet',
81 aliases: [ 'pp' ],
82 contains: [
83 COMMENT,
84 VARIABLE,
85 STRING,
86 {
87 beginKeywords: 'class',
88 end: '\\{|;',
89 illegal: /=/,
90 contains: [
91 TITLE,
92 COMMENT
93 ]
94 },
95 {
96 beginKeywords: 'define',
97 end: /\{/,
98 contains: [
99 {
100 className: 'section',
101 begin: hljs.IDENT_RE,
102 endsParent: true
103 }
104 ]
105 },
106 {
107 begin: hljs.IDENT_RE + '\\s+\\{',
108 returnBegin: true,
109 end: /\S/,
110 contains: [
111 {
112 className: 'keyword',
113 begin: hljs.IDENT_RE,
114 relevance: 0.2
115 },
116 {
117 begin: /\{/,
118 end: /\}/,
119 keywords: PUPPET_KEYWORDS,
120 relevance: 0,
121 contains: [
122 STRING,
123 COMMENT,
124 {
125 begin: '[a-zA-Z_]+\\s*=>',
126 returnBegin: true,
127 end: '=>',
128 contains: [
129 {
130 className: 'attr',
131 begin: hljs.IDENT_RE
132 }
133 ]
134 },
135 {
136 className: 'number',
137 begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
138 relevance: 0
139 },
140 VARIABLE
141 ]
142 }
143 ],
144 relevance: 0
145 }
146 ]
147 };
148 }
149
150 return puppet;
151
152 })();
153 ;
154 export default hljsGrammar;