%YAML 1.2
---
name: LLHD
file_extensions:
- llhd
scope: source.llhd
contexts:
main:
- match: ';'
scope: punctuation.definition.comment.llhd
push: line_comment
- match: '\b(func|proc|entity)\s+([%@][a-zA-Z0-9_\.\\]+)'
scope: meta.unit.llhd
captures:
1: keyword.unit.llhd
2: entity.name.class.llhd
- match: '\b(const|alias|mux|reg|insf|inss|extf|exts|del|call|con|inst|drv|st|halt|ret|br|wait|not|neg|sig|prb|var|ld|add|sub|and|or|xor|smul|sdiv|smod|srem|umul|udiv|umod|urem|eq|neq|slt|sgt|sle|sge|ult|ugt|ule|uge|shl|shr|phi)\b'
scope: keyword.opcode.llhd
- match: '\b(for|low|high|rise|fall|both)\b'
scope: keyword.operator.llhd
- match: '(\bvoid\b|\btime\b|[iln]\d+|[\*\$]|\d+\s*x\s*)'
scope: keyword.operator.llhd
- match: '[a-zA-Z0-9_\.\\]+:'
scope: variable.language.llhd
- match: '[%][a-zA-Z0-9_\.\\]+'
scope: variable.local.llhd
- match: '[@][a-zA-Z0-9_\.\\]+'
scope: entity.name.class.llhd
- match: '[({\[]'
scope: punctuation.section.group.begin.llhd
- match: '[)}\]]'
scope: punctuation.section.group.end.llhd
- match: '(,|->)'
scope: punctuation.separator.llhd
- match: '='
scope: keyword.operator.llhd
- match: '\b(-)?[0-9.]+([afpnum]?s|e|d)?\b'
scope: constant.numeric.llhd
line_comment:
- meta_scope: comment.line.llhd
- match: $
pop: true