From eaf4eb2d63d1c7581d3ed93625457bba5d614d70 Mon Sep 17 00:00:00 2001 From: Amr Tamimi Date: Thu, 23 Mar 2017 11:27:44 +0100 Subject: [PATCH] fix python syntax to prioritize multi liner comments --- syntax_files/python2.yaml | 24 ++++++++++++------------ syntax_files/python3.yaml | 28 ++++++++++++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/syntax_files/python2.yaml b/syntax_files/python2.yaml index bddf66d..971b2cd 100644 --- a/syntax_files/python2.yaml +++ b/syntax_files/python2.yaml @@ -29,18 +29,6 @@ rules: # numbers - constant.number: "\\b[0-9]+\\b" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - comment: start: "#" end: "$" @@ -55,3 +43,15 @@ rules: start: "'''" end: "'''" rules: [] + + - constant.string: + start: "\"" + end: "\"" + rules: + - constant.specialChar: "\\\\." + + - constant.string: + start: "'" + end: "'" + rules: + - constant.specialChar: "\\\\." diff --git a/syntax_files/python3.yaml b/syntax_files/python3.yaml index 864089a..c721551 100644 --- a/syntax_files/python3.yaml +++ b/syntax_files/python3.yaml @@ -16,9 +16,9 @@ rules: # types - type: "\\b(bool|bytearray|bytes|classmethod|complex|dict|enumerate|filter|float|frozenset|int|list|map|memoryview|object|property|range|reversed|set|slice|staticmethod|str|super|tuple|type|zip)\\b" # definitions - - identifier: "def [a-zA-Z_0-9]+" + - identifier: "def [a-zA-Z_0-9]+" # keywords - - statement: "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b" + - statement: "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b" # decorators - brightgreen: "@.*[(]" # operators @@ -28,18 +28,6 @@ rules: # numbers - constant.number: "\\b[0-9]+\\b" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - comment: start: "#" end: "$" @@ -54,3 +42,15 @@ rules: start: "'''" end: "'''" rules: [] + + - constant.string: + start: "\"" + end: "\"" + rules: + - constant.specialChar: "\\\\." + + - constant.string: + start: "'" + end: "'" + rules: + - constant.specialChar: "\\\\."