Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chanryu committed Jan 16, 2023
2 parents 97412f1 + 526103a commit 74beb7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions generate-syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"match": "(__KEY__)\\s*__SEP__\\s*((__VALUE_REGEX__)[^__TERM__\\s]+)",
"captures": {
"1": { "name": "__STYLE_PROP_NAME__" },
"2": { "name": "__STYLE_PROP_WRONG_VALUE__" }
"2": { "name": "__STYLE_INVALID__" }
}
},
{
Expand All @@ -67,7 +67,7 @@
"1": { "name": "__STYLE_PROP_NAME__" },
"3": { "name": "__STYLE_PROP_VALUE__" },
"4": { "name": "__STYLE_VARIABLE__" },
"__WRONG_VALUE_INDEX__": { "name": "__STYLE_PROP_WRONG_VALUE__" }
"__WRONG_VALUE_INDEX__": { "name": "__STYLE_INVALID__" }
}
}'''

Expand Down Expand Up @@ -96,7 +96,7 @@
"name": "__STYLE_LENGTH__",
"match": "[+-]?([0-9]*[.])?[0-9]+(pw|ph|cw|ch|mt|mr|mb|ml|sbh|eb|%)?",
"captures": {
"4": "__STYLE_PROP_WRONG_VALUE__"
"4": "__STYLE_INVALID__"
}
}
'''
Expand Down Expand Up @@ -128,8 +128,8 @@
# common styles
'__STYLE_PROP_NAME__': 'entity.other.attribute-name',
'__STYLE_PROP_VALUE__': 'string',
'__STYLE_PROP_WRONG_VALUE__': 'invalid.illegal',
'__STYLE_PROP_SEP__': 'keyword.operator',
'__STYLE_INVALID__': 'invalid.illegal',
'__STYLE_VARIABLE__': 'string markup.italic',
'__STYLE_FILENAME__': 'string',
'__STYLE_LENGTH__': 'constant.numeric',
Expand Down
5 changes: 5 additions & 0 deletions sbss.tmLanguage.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
},
"property-group": {
"patterns": [
{
"match": "([a-z-]+(@[a-z-]+)?)\\s*=.*$",
"name": "__STYLE_INVALID__",
"comment": "A common mistake - property list style pair in property group."
},
"__PROP_GROUP_PATTERNS__"
]
},
Expand Down

0 comments on commit 74beb7d

Please sign in to comment.