Example #1
0
    def t_doublequote(self, s, m, parent):
        r'" [^"\\\n]* ( ( ((\\(.|\n)|\n)[\s?]*) | "" ) [^"\\\n]* )* "'
        if parent.current[-1] == _COMMAND_MODE:
            parent.addToken(type=parent.argsep)
            parent.argsep = ','

        nline = _countNewlines(s)

        # Recognize and remove any embedded comments
        s = comment_pat.sub('',s)

        s = filterEscapes(irafutils.removeEscapes(
                     irafutils.stripQuotes(s),quoted=1))
        parent.addToken(type='QSTRING', attr=s)
        parent.lineno = parent.lineno + nline
Example #2
0
    def t_doublequote(self, s, m, parent):
        r'" [^"\\\n]* ( ( ((\\(.|\n)|\n)[\s?]*) | "" ) [^"\\\n]* )* "'
        if parent.current[-1] == _COMMAND_MODE:
            parent.addToken(type=parent.argsep)
            parent.argsep = ','

        nline = _countNewlines(s)

        # Recognize and remove any embedded comments
        s = comment_pat.sub('', s)

        s = filterEscapes(
            irafutils.removeEscapes(irafutils.stripQuotes(s), quoted=1))
        parent.addToken(type='QSTRING', attr=s)
        parent.lineno = parent.lineno + nline
Example #3
0
    def t_singlequote(self, s, m, parent):
        r"' [^'\\\n]* ( ( ((\\(.|\n)|\n)[\s?]*) | '' ) [^'\\\n]* )*'"
        # this pattern allows both escaped embedded quotes and
        # embedded double quotes ('embedded''quotes')
        # it also allows escaped newlines
        if parent.current[-1] == _COMMAND_MODE:
            parent.addToken(type=parent.argsep)
            parent.argsep = ','

        nline = _countNewlines(s)
        # Recognize and remove any embedded comments
        s = comment_pat.sub('',s)

        s = filterEscapes(irafutils.removeEscapes(
                     irafutils.stripQuotes(s),quoted=1))
        # We use a different type for quoted strings to protect them
        # against conversion to other token types by enterComputeEqnMode
        parent.addToken(type='QSTRING', attr=s)
        parent.lineno = parent.lineno + nline
Example #4
0
    def t_singlequote(self, s, m, parent):
        r"' [^'\\\n]* ( ( ((\\(.|\n)|\n)[\s?]*) | '' ) [^'\\\n]* )*'"
        # this pattern allows both escaped embedded quotes and
        # embedded double quotes ('embedded''quotes')
        # it also allows escaped newlines
        if parent.current[-1] == _COMMAND_MODE:
            parent.addToken(type=parent.argsep)
            parent.argsep = ','

        nline = _countNewlines(s)
        # Recognize and remove any embedded comments
        s = comment_pat.sub('', s)

        s = filterEscapes(
            irafutils.removeEscapes(irafutils.stripQuotes(s), quoted=1))
        # We use a different type for quoted strings to protect them
        # against conversion to other token types by enterComputeEqnMode
        parent.addToken(type='QSTRING', attr=s)
        parent.lineno = parent.lineno + nline