aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-09 22:30:00 -0400
committerKen Moore <ken@ixsystems.com>2017-06-09 22:30:00 -0400
commit47d278d6f45c0e82ec2efe7abc9ccc71b356e9df (patch)
tree3c7cd69dc97e3f158e0be802d68aa5923b7546ca /src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-47d278d6f45c0e82ec2efe7abc9ccc71b356e9df.tar.gz
lumina-47d278d6f45c0e82ec2efe7abc9ccc71b356e9df.tar.bz2
lumina-47d278d6f45c0e82ec2efe7abc9ccc71b356e9df.zip
Get the new syntax rule system all setup and on-par (or better) than we had previously. Now we are all set for new rule sets to just be dropped in without worry about recompiling or anything.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax50
1 files changed, 50 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax
new file mode 100644
index 00000000..f6d2223d
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/python.syntax
@@ -0,0 +1,50 @@
+# Syntax support file for the Lumina Text Editor
+# ===================================
+# Python language support rules
+# Written by Ken Moore <ken@ixsystems.com>
+# Released under the 2-clause BSD license
+# ===================================
+
+{
+ "meta": {
+ "name": "Python (Experimental)",
+ "file_suffix": ["py", "pyc"]
+ },
+ "format": {
+ "line_wrap": false,
+ "highlight_whitespace_eol": true
+ },
+ "rules": [{
+ "name": "single-line comment",
+ "regex": "#[^\n]*",
+ "foreground": "colors/comment"
+ },
+ {
+ "name": "keywords",
+ "words": ["and" , "as" , "assert" , "break" , "class" , "continue" , "def" , "del" , "elif" , "else" , "except" , "exec" , "finally" , "for" , "from" , "global" , "if" , "import" , "in" , "is" , "lambda" , "not" , "or" , "pass" , "print" , "raise" , "return" , "try" , "while" , "with" , "yield"],
+ "foreground": "colors/keyword",
+ "font_weight": "bold"
+ },
+ {
+ "name": "class names",
+ "regex": "\\bQ[A-Za-z]+\\b",
+ "foreground": "colors/class",
+ "font_weight": "bold"
+ },
+ {
+ "name": "function names",
+ "regex": "\\b[A-Za-z0-9_]+(?=\\()",
+ "foreground": "colors/function"
+ },
+ {
+ "name": "text",
+ "regex": "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'",
+ "foreground": "colors/text"
+ },
+ {
+ "name": "preprocessor",
+ "regex": "^[\\s]*#[^\n]*",
+ "foreground": "colors/preprocessor"
+ }
+ ]
+}
bgstack15