Exemple #1
0
 def createCStyleDef(findState =None):
     return BlockDefinition(
         'CSTYLE', '/*', BlockSyntaxEnum.COMMENT, '*/',
         matchReqs=MatchLookDefinition.createIgnoreEscapes(),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )
Exemple #2
0
 def createQuoteDef(findState =None):
     return BlockDefinition(
         'QUOTES', '"', BlockSyntaxEnum.STRING,
         matchReqs=MatchLookDefinition.createIgnoreEscapes(),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )
Exemple #3
0
 def createQuoteDef(findState=None):
     return BlockDefinition(
         'QUOTES',
         '"',
         BlockSyntaxEnum.STRING,
         matchReqs=MatchLookDefinition.createIgnoreEscapes(),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #4
0
 def createRegexDef(findState=None):
     return BlockDefinition(
         'REGEX',
         '/',
         BlockSyntaxEnum.REGEX,
         matchReqs=MatchLookDefinition('[A-Za-z0-9_\)\]\}]{1}[\s\t\n]*'),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #5
0
 def createVizmeMLCloseDef(findState=None):
     return BlockDefinition('VIZMEML_CLOSE',
                            '[/#',
                            BlockSyntaxEnum.VIZMEML_CLOSE,
                            ']',
                            matchReqs=MatchLookDefinition('[^A-Za-z_\]]+',
                                                          lookAhead=True),
                            terminatorReqs=MatchLookDefinition('\*'),
                            findState=findState)
Exemple #6
0
 def createCStyleDef(findState=None):
     return BlockDefinition(
         'CSTYLE',
         '/*',
         BlockSyntaxEnum.COMMENT,
         '*/',
         matchReqs=MatchLookDefinition.createIgnoreEscapes(),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #7
0
 def createDocTagDef(findState=None):
     return BlockDefinition(
         'DOCTAG',
         '@@@',
         BlockSyntaxEnum.DOC_TAG,
         '\n',
         matchReqs=MatchLookDefinition('[A-Za-z0-9_]+'),
         terminatorReqs=MatchLookDefinition('[\t\s]*(@@@[A-Za-z0-9_]+|$)'),
         findState=findState)
Exemple #8
0
 def createLiteralDef(findState=None, avoidApostrophes=False):
     return BlockDefinition(
         'LITERAL',
         re.compile('(?<![A-Za-z0-9])\'') if avoidApostrophes else '\'',
         BlockSyntaxEnum.STRING,
         re.compile('\'(?![A-Za-z0-9])') if avoidApostrophes else None,
         matchReqs=MatchLookDefinition.createIgnoreEscapes(),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #9
0
 def createVizmeMLAttributeDef(findState=None):
     return BlockDefinition('VIZMEML_ATTR',
                            re.compile('(^|[\s\t\n]+)'),
                            BlockSyntaxEnum.VIZMEML_ATTR,
                            re.compile('($|[\s\t\n]+)'),
                            matchReqs=MatchLookDefinition(',', True),
                            terminatorReqs=MatchLookDefinition(',', True),
                            findState=findState,
                            chainBlocks=True,
                            closeAtEnd=True)
Exemple #10
0
 def createLiteralDef(findState =None, avoidApostrophes =False):
     return BlockDefinition(
         'LITERAL',
         re.compile('(?<![A-Za-z0-9])\'') if avoidApostrophes else '\'',
         BlockSyntaxEnum.STRING,
         re.compile('\'(?![A-Za-z0-9])') if avoidApostrophes else None,
         matchReqs=MatchLookDefinition.createIgnoreEscapes(),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )
Exemple #11
0
 def createTripleLiteralsDef(findState=None):
     return BlockDefinition(
         'TRIPLELITERALS',
         "'''",
         BlockSyntaxEnum.STRING,
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #12
0
 def createRegexDef(findState =None):
     return BlockDefinition(
         'REGEX', '/', BlockSyntaxEnum.REGEX,
         matchReqs=MatchLookDefinition('[A-Za-z0-9_\)\]\}]{1}[\s\t\n]*'),
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )
Exemple #13
0
 def createTripleQuotesDef(findState=None):
     return BlockDefinition(
         'TRIPLEQUOTES',
         '"""',
         BlockSyntaxEnum.STRING,
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #14
0
 def createSlashDef(findState=None):
     return BlockDefinition(
         'SLASH',
         '//',
         BlockSyntaxEnum.COMMENT,
         '\n',
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState)
Exemple #15
0
 def createSlashDef(findState =None):
     return BlockDefinition(
         'SLASH', '//', BlockSyntaxEnum.COMMENT, '\n',
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )
Exemple #16
0
 def createTripleLiteralsDef(findState =None):
     return BlockDefinition(
         'TRIPLELITERALS', "'''", BlockSyntaxEnum.STRING,
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )
Exemple #17
0
 def createTripleQuotesDef(findState =None):
     return BlockDefinition(
         'TRIPLEQUOTES', '"""', BlockSyntaxEnum.STRING,
         terminatorReqs=MatchLookDefinition.createIgnoreEscapes(),
         findState=findState
     )