Paste: micro syntax definition for Factor
Author: | AI |
Mode: | yaml |
Date: | Sun, 8 Dec 2024 04:50:07 |
Plain Text |
filetype: factor
detect:
filename: "\\.factor(-rc)?$"
rules:
- comment: "!.*$"
- comment: "/\\*.*\\*/"
- symbol.operator: "\\[|\\]|\\(|\\)|\\{|\\}|;|--|:|>>"
- constant.string: "\".*\""
- constant: "\\b(t|f)\\b"
- type: "\\b[A-Z][A-Z0-9_-]*:\\b"
- type: "\\b(USING:|IN:|FROM:|QUALIFIED:|ALIAS:|RENAME:)\\b"
- statement: "\\b(2nip|2dup|2drop|2bi|2tri|2curry|2dip|2keep|2over|3bi|3curry|3dip|3drop|3dup|3keep|3tri|4dip|4drop|4dup|4keep|deep-clone|keep-under|bi-curry|clone|\\?execute|\\?if|and|assert|assert=|assert\\?|bi-curry|bi@|bi\\*|boolean|call|clear|compose|curry|die|dip|do|drop|dup|execute|if|keep|loop|new|nip|not|null|object|or|over|pick|rot|swap|throw|unless|until|when|while|with|wrapper)\\b"
- identifier: "^:\\s+[\\w-]+\\b"
- constant.number: "\\b[0-9]+\\b"
New Annotation