Files
Agent-n8n/backups/exhibition-demo-backup-20250928-210916/node_modules/refractor/lang/swift.js
Yep_Q 67f5dfbe50 feat: 实现多订单班支持系统
主要功能:
- 修改RequirementModal支持12个订单班选择
- 添加OrderClassIconMap图标映射组件
- Store中添加selectedOrderClass状态管理
- WorkflowPage支持传递orderClass参数
- web_result添加URL参数切换功能
- 创建order-class-handler.js动态处理页面主题

技术改进:
- 创建软链接关联订单班数据目录
- 生成wenlu.json和food.json数据结构
- 删除重复的web_result目录
- 添加测试页面test-order-class.html

影响范围:
- 展会策划系统现支持12个订单班
- 结果展示页面自动适配不同订单班主题
- 用户可选择不同行业生成对应方案

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 10:02:15 +08:00

150 lines
5.2 KiB
JavaScript

'use strict'
module.exports = swift
swift.displayName = 'swift'
swift.aliases = []
function swift(Prism) {
Prism.languages.swift = {
comment: {
// Nested comments are supported up to 2 levels
pattern:
/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,
lookbehind: true,
greedy: true
},
'string-literal': [
// https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html
{
pattern: RegExp(
/(^|[^"#])/.source +
'(?:' + // single-line string
/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/
.source +
'|' + // multi-line string
/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/
.source +
')' +
/(?!["#])/.source
),
lookbehind: true,
greedy: true,
inside: {
interpolation: {
pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/,
lookbehind: true,
inside: null // see below
},
'interpolation-punctuation': {
pattern: /^\)|\\\($/,
alias: 'punctuation'
},
punctuation: /\\(?=[\r\n])/,
string: /[\s\S]+/
}
},
{
pattern: RegExp(
/(^|[^"#])(#+)/.source +
'(?:' + // single-line string
/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/
.source +
'|' + // multi-line string
/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source +
')' +
'\\2'
),
lookbehind: true,
greedy: true,
inside: {
interpolation: {
pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,
lookbehind: true,
inside: null // see below
},
'interpolation-punctuation': {
pattern: /^\)|\\#+\($/,
alias: 'punctuation'
},
string: /[\s\S]+/
}
}
],
directive: {
// directives with conditions
pattern: RegExp(
/#/.source +
'(?:' +
(/(?:elseif|if)\b/.source +
'(?:[ \t]*' + // This regex is a little complex. It's equivalent to this:
// (?:![ \t]*)?(?:\b\w+\b(?:[ \t]*<round>)?|<round>)(?:[ \t]*(?:&&|\|\|))?
// where <round> is a general parentheses expression.
/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/
.source +
')+') +
'|' +
/(?:else|endif)\b/.source +
')'
),
alias: 'property',
inside: {
'directive-name': /^#\w+/,
boolean: /\b(?:false|true)\b/,
number: /\b\d+(?:\.\d+)*\b/,
operator: /!|&&|\|\||[<>]=?/,
punctuation: /[(),]/
}
},
literal: {
pattern:
/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,
alias: 'constant'
},
'other-directive': {
pattern: /#\w+\b/,
alias: 'property'
},
attribute: {
pattern: /@\w+/,
alias: 'atrule'
},
'function-definition': {
pattern: /(\bfunc\s+)\w+/,
lookbehind: true,
alias: 'function'
},
label: {
// https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html#ID141
pattern:
/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,
lookbehind: true,
alias: 'important'
},
keyword:
/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,
boolean: /\b(?:false|true)\b/,
nil: {
pattern: /\bnil\b/,
alias: 'constant'
},
'short-argument': /\$\d+\b/,
omit: {
pattern: /\b_\b/,
alias: 'keyword'
},
number:
/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
// A class name must start with an upper-case letter and be either 1 letter long or contain a lower-case letter.
'class-name': /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,
function: /\b[a-z_]\w*(?=\s*\()/i,
constant: /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
// Operators are generic in Swift. Developers can even create new operators (e.g. +++).
// https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html#ID481
// This regex only supports ASCII operators.
operator: /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,
punctuation: /[{}[\]();,.:\\]/
}
Prism.languages.swift['string-literal'].forEach(function (rule) {
rule.inside['interpolation'].inside = Prism.languages.swift
})
}