mirror of https://github.com/kivy/kivy.git
Make kv string detection more robust.
Should make all legal python quoting legal in KV. Including mutliline text.
This commit is contained in:
parent
6b2bffffa6
commit
08926eb4a1
|
@ -34,7 +34,11 @@ Cache.register('kv.lang')
|
|||
__KV_INCLUDES__ = []
|
||||
|
||||
# precompile regexp expression
|
||||
lang_str = re.compile('([\'"][^\'"]*[\'"])')
|
||||
lang_str = re.compile(
|
||||
"((?:'''.*?''')|"
|
||||
"(?:(?:(?<!')|''')'(?:[^']|\\\\')+?'(?:(?!')|'''))|"
|
||||
'(?:""".*?""")|'
|
||||
'(?:(?:(?<!")|""")"(?:[^"]|\\\\")+?"(?:(?!")|""")))', re.DOTALL)
|
||||
lang_key = re.compile('([a-zA-Z_]+)')
|
||||
lang_keyvalue = re.compile('([a-zA-Z_][a-zA-Z0-9_.]*\.[a-zA-Z0-9_.]+)')
|
||||
lang_tr = re.compile('(_\()')
|
||||
|
|
Loading…
Reference in New Issue