物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.5 KiB

var r={},l=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;function s(t,e){for(var i=e.split(" "),a=0;a<i.length;a++)r[i[a]]=t}s("keyword","class define site node include import inherits");s("keyword","case if else in and elsif default or");s("atom","false true running present absent file directory undef");s("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool");function c(t,e){for(var i,a,o=!1;!t.eol()&&(i=t.next())!=e.pending;){if(i==="$"&&a!="\\"&&e.pending=='"'){o=!0;break}a=i}return o&&t.backUp(1),i==e.pending?e.continueString=!1:e.continueString=!0,"string"}function p(t,e){var i=t.match(/[\w]+/,!1),a=t.match(/(\s+)?\w+\s+=>.*/,!1),o=t.match(/(\s+)?[\w:_]+(\s+)?{/,!1),u=t.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),n=t.next();if(n==="$")return t.match(l)?e.continueString?"variableName.special":"variable":"error";if(e.continueString)return t.backUp(1),c(t,e);if(e.inDefinition){if(t.match(/(\s+)?[\w:_]+(\s+)?/))return"def";t.match(/\s+{/),e.inDefinition=!1}return e.inInclude?(t.match(/(\s+)?\S+(\s+)?/),e.inInclude=!1,"def"):t.match(/(\s+)?\w+\(/)?(t.backUp(1),"def"):a?(t.match(/(\s+)?\w+/),"tag"):i&&r.hasOwnProperty(i)?(t.backUp(1),t.match(/[\w]+/),t.match(/\s+\S+\s+{/,!1)&&(e.inDefinition=!0),i=="include"&&(e.inInclude=!0),r[i]):/(^|\s+)[A-Z][\w:_]+/.test(i)?(t.backUp(1),t.match(/(^|\s+)[A-Z][\w:_]+/),"def"):o?(t.match(/(\s+)?[\w:_]+/),"def"):u?(t.match(/(\s+)?[@]{1,2}/),"atom"):n=="#"?(t.skipToEnd(),"comment"):n=="'"||n=='"'?(e.pending=n,c(t,e)):n=="{"||n=="}"?"bracket":n=="/"?(t.match(/^[^\/]*\//),"string.special"):n.match(/[0-9]/)?(t.eatWhile(/[0-9]+/),"number"):n=="="?(t.peek()==">"&&t.next(),"operator"):(t.eatWhile(/[\w-]/),null)}const d={name:"puppet",startState:function(){var t={};return t.inDefinition=!1,t.inInclude=!1,t.continueString=!1,t.pending=!1,t},token:function(t,e){return t.eatSpace()?null:p(t,e)}};export{d as puppet};