Commits

Thomas Aglassinger committed aed0ca2

Moved FOCUS related lexers to separate branch in order to simplify pyments.main pull request #169.

  • Participants
  • Parent commits ab1412c

Comments (0)

Files changed (8)

pygments/lexers/_mapping.py

     'FancyLexer': ('pygments.lexers.agile', 'Fancy', ('fancy', 'fy'), ('*.fy', '*.fancypack'), ('text/x-fancysrc',)),
     'FantomLexer': ('pygments.lexers.compiled', 'Fantom', ('fan',), ('*.fan',), ('application/x-fantom',)),
     'FelixLexer': ('pygments.lexers.compiled', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)),
-    'FocusAccessLexer': ('pygments.lexers.other', 'FOCUS access', ('focus-access',), ('*.acx',), ('text/x-focus-access',)),
-    'FocusMasterLexer': ('pygments.lexers.other', 'FOCUS master', ('focus-master',), ('*.mas',), ('text/x-focus-master',)),
-    'FocusStyleSheetLexer': ('pygments.lexers.other', 'FOCUS style sheet', ('focus-style',), ('*.sty',), ('text/x-focus-style',)),
     'FortranLexer': ('pygments.lexers.compiled', 'Fortran', ('fortran',), ('*.f', '*.f90', '*.F', '*.F90'), ('text/x-fortran',)),
     'FoxProLexer': ('pygments.lexers.foxpro', 'FoxPro', ('Clipper', 'XBase'), ('*.PRG', '*.prg'), ()),
     'GLShaderLexer': ('pygments.lexers.compiled', 'GLSL', ('glsl',), ('*.vert', '*.frag', '*.geo'), ('text/x-glslsrc',)),
     'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('verilog', 'v'), ('*.v',), ('text/x-verilog',)),
     'VhdlLexer': ('pygments.lexers.hdl', 'vhdl', ('vhdl',), ('*.vhdl', '*.vhd'), ('text/x-vhdl',)),
     'VimLexer': ('pygments.lexers.text', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc'), ('text/x-vim',)),
-    'WebFocusLexer': ('pygments.lexers.other', 'WebFOCUS', ('webfocus', 'FOCUS', 'focus'), ('*.fex',), ('text/x-webfocus', 'text/x-focus')),
     'XQueryLexer': ('pygments.lexers.web', 'XQuery', ('xquery', 'xqy', 'xq', 'xql', 'xqm'), ('*.xqy', '*.xquery', '*.xq', '*.xql', '*.xqm'), ('text/xquery', 'application/xquery')),
     'XmlDjangoLexer': ('pygments.lexers.templates', 'XML+Django/Jinja', ('xml+django', 'xml+jinja'), (), ('application/xml+django', 'application/xml+jinja')),
     'XmlErbLexer': ('pygments.lexers.templates', 'XML+Ruby', ('xml+erb', 'xml+ruby'), (), ('application/xml+ruby',)),

pygments/lexers/other.py

            'MscgenLexer', 'KconfigLexer', 'VGLLexer', 'SourcePawnLexer',
            'RobotFrameworkLexer', 'PuppetLexer', 'NSISLexer', 'RPMSpecLexer',
            'CbmBasicV2Lexer', 'AutoItLexer', 'EasytrieveLexer', 'JclLexer',
-           'RexxLexer', 'WebFocusLexer', 'FocusAccessLexer',
-           'FocusMasterLexer', 'FocusStyleSheetLexer']
+           'RexxLexer']
 
 
 class ECLLexer(RegexLexer):
         return result
 
 
-class WebFocusLexer(RegexLexer):
-    """
-    `(Web)FOCUS <http://www.informationbuilders.com/products/webfocus/>`_ is
-    a language for business intelligence applications. It enables to
-    describe, query and modify data from various sources including mainframe
-    platforms. It also includes FIDEL, a language to describe input forms.
-
-    *New in Pygments 1.7.*
-    """
-    name = 'WebFOCUS'
-    aliases = ['webfocus', 'FOCUS', 'focus']
-    filenames = ['*.fex']
-    mimetypes = ['text/x-webfocus', 'text/x-focus']
-    flags = re.IGNORECASE
-
-    # TODO: Consolidate rules common to 'focus' and 'dialog_manager' with 'include' or something.
-    # TODO: Find out if FIDEL supports "" to escape " and if so implement it.
-    # TODO: Add support for backslash escapes in single quote strings (and maybe double quote too?).
-    # TODO: Support dialog manager FIDEL input modifiers such as '.nodisplay'.
-    # TODO: Highlight function name after DEFINE FUNCTION.
-    # TODO: Highlight field name for all field types, not only numeric ones.
-    tokens = {
-        'root': [
-            (r'-\*.*\n', Comment.Single),
-            (r'-', Punctuation, 'dialog_manager'),
-            include('focus')
-         ],
-        'focus': [
-            (r'\n', Text, 'root'),
-            (r'\s*(across|add|alloc|as|by|clear|column-total|compute|count|'
-             r'crtform|decode|define|dynam|else|end|ex|exceeds|exec|file|'
-             r'filter|footing|for|format|free|heading|highest|hold|if|'
-             r'in-groups-of|in-ranges-of|join|list|lowest|match|modify|'
-             r'multilines|newpage|nomatch|noprint|nototal|on|over|'
-             r'page-break|print|printonly|ranked|recap|recompute|redefines|'
-             r'reject|row-total|rows|savb|save|set|sub-total|subfoot|'
-             r'subhead|subtotal|sum|summarize|tablef|table|the|then|tiles|'
-             r'total|update|when|where|with|within)\b', Keyword.Reserved),
-            (r'"', String, 'focus_fidel'),
-            (r'\b(missing)\b', Name.Constant),
-            (r'\b(asq|ave|cnt|ct|dst|fst|lst|max|min|pct|rcpt|st|sum|tot)\.',
-             Operator),
-            # FOCUS field declaration including display options.
-            (r'([a-z][a-z_0-9]*)([/])([adfip]*[0-9]+(\.[0-9]+)[-%bcdelmnrsty]*)',
-             bygroups(Name.Variable, Operator, Keyword.Type)),
-            # Rules common to 'focus' and 'dialog_manager'.
-            (r'\b(and|contains|div|eq|exceeds|excludes|from|ge|gt|in|'
-             r'includes|is-from|is-less-than|is-more-than|'
-             r'is-not-missing|is|le|like|lt|mod|ne|not-from|not|omits|or|to)\b',
-             Operator),
-            (r'[-+*/=|!]', Operator),
-            (r'[(){}<>;,]', Punctuation),
-            (r'[a-z_][a-z_0-9]*', Literal),
-            (r'&+[a-z_][a-z_0-9]*', Literal),
-            (r'[0-9]+\.[0-9]*', Number.Float),
-            (r'\.[0-9]+', Number.Float),
-            (r'[0-9]+', Number.Integer),
-            (r"'(''|[^'])*'", String),
-            (r'\s+', Whitespace)
-        ],
-        'dialog_manager': [
-            # Detect possible labels in first word of dialog manager line.
-            (r'\s*type\b', Keyword.Reserved, 'dialog_manager_type'),
-            (r':[a-z_][a-z_0-9]*\s*\n', Name.Label, 'root'),
-            (r'"', String, 'dialog_manager_fidel'),
-            # TODO: Get rid of redundant dialog manager keyword rule which
-            # already could be handled by the included
-            # 'dialog_manager_others'. However, we currently need it to not
-            # recognize classic labels without ':' too soon.
-            (r'\b(\?|close|cms|crtclear|crtform|default|defaults|else|exit|'
-             r'goto|htmlform|if|include|mvs|pass|prompt|quit|read|repeat|'
-             r'run|set|then|tso|type|window|write)\b', Keyword.Reserved,
-             'dialog_manager_others'),
-            (r'[a-z_][a-z_0-9]*\s*\n', Name.Label, 'root'),
-            include('dialog_manager_others'),
-        ],
-        'dialog_manager_others': [
-            (r'\n', Text, 'root'),
-            (r'\s*type\b', Keyword.Reserved, 'dialog_manager_type'),
-            (r':[a-z_][a-z_0-9]*\s*\n', Name.Label, 'root'),
-            (r'\b(\?|close|cms|crtclear|crtform|default|defaults|else|exit|'
-             r'goto|htmlform|if|include|mvs|pass|prompt|quit|read|repeat|'
-             r'run|set|then|tso|type|window|write)\b', Keyword.Reserved),
-            # Rules common to 'focus' and 'dialog_manager'.
-            (r'\b(and|contains|div|eq|exceeds|excludes|from|ge|gt|in|'
-             r'includes|is|is-from|is-from|is-less-than|is-more-than|'
-             r'is-not-missing|le|like|lt|mod|ne|not|not-from|omits|or|to)\b',
-             Operator),
-            (r'[-+*/=|!]', Operator),
-            (r'[(){}<>;,]', Punctuation),
-            (r'[a-z_][a-z_0-9]*', Literal),
-            (r'&+[a-z_][a-z_0-9]*', Name.Variable),
-            (r'[0-9]+\.[0-9]*', Number.Float),
-            (r'\.[0-9]+', Number.Float),
-            (r'[0-9]+', Number.Integer),
-            (r"'(''|[^'])*'", String),
-            (r'\s+', Whitespace)
-        ],
-        'dialog_manager_type': [
-            # For -TYPE, render everything as ``String`` except variables.
-            (r'\n', Text, 'root'),
-            (r'&+[a-z_][a-z_0-9]*\.*', Name.Variable),
-            (r'[^&\n]+', String)
-        ],
-        'dialog_manager_fidel': [
-            (r'"', String, 'dialog_manager_fidel_end'),
-            (r'(<)(&[a-z][a-z_0-9]*)([/])([0-9]+)',
-             bygroups(Keyword.Reserved, Name.Variable, Operator, Number.Integer)),
-            (r'.', String)
-        ],
-        'dialog_manager_fidel_end': [
-            (r'\n', Text, 'root'),
-            (r'\s+', Whitespace)
-        ],
-        'focus_fidel': [
-            (r'"', String, 'focus_fidel_end'),
-            (r'&+[a-z][a-z_0-9]*', Name.Variable),
-            (r'\>', Keyword.Reserved),
-            # Line continuation.
-            (r'\<0x\s*\n', Keyword.Reserved),
-            (r'(<)([a-z][a-z_0-9]*)',
-             bygroups(Keyword.Reserved, Name.Variable)),
-            (r'(<)(\+|-|/)?([0-9]+)',
-             bygroups(Keyword.Reserved, Operator, Number.Integer)),
-            (r'.', String)
-        ],
-        'focus_fidel_end': [
-            (r'\n', Text, 'root'),
-            (r'\s+', Whitespace)
-       ]
-    }
-
-    def analyse_text(text):
-        """
-        Perform a heuristic analysis for certain very common WebFOCUS
-        constructs.
-        """
-        result = 0.0
-        hasComment = False
-        hasExec = False
-        hasInclude = False
-        hasSet = False
-        hasTableFile = False
-
-        # Scan the source lines for indicators.
-        for line in text.lower().split('\n'):
-            if line.startswith('-'):
-                words = line[1:].split()
-                wordCount = len(words)
-                if wordCount > 0:
-                    firstWord = words[0]
-                    if firstWord.startswith('*'):
-                        hasComment = True
-                    elif wordCount > 1:
-                        if firstWord == 'include':
-                            hasInclude = True
-                        elif (firstWord == 'set') and words[1].startswith('&'):
-                            hasSet = True
-            else:
-                words = line.split()
-                wordCount = len(words)
-                if wordCount > 1:
-                    if words[0] in ('ex', 'exec'):
-                        hasExec = True
-                    elif (words[0] in ('table', 'tablef')) \
-                            and (words[1] == 'file'):
-                        hasTableFile = True
-        if hasComment:
-            result += 0.2
-        if hasExec or hasInclude:
-            result += 0.1
-        if hasTableFile:
-            result += 0.2
-        if hasSet:
-            result += 0.1
-        assert 0.0 <= result <= 1.0
-        return result
-
-
-class FocusMasterLexer(RegexLexer):
-    """
-    FOCUS master files describes files and tables to be queried by FOCUS
-    programs. The are somewhat comparable to SQL ``create table`` statements.
-
-    *New in Pygments 1.7.*
-    """
-    name = 'FOCUS master'
-    aliases = ['focus-master']
-    filenames = ['*.mas']
-    mimetypes = ['text/x-focus-master']
-    flags = re.IGNORECASE
-
-    tokens = {
-        'root': [
-            (r'-\*.*\n', Comment.Single),
-            include('name'),
-         ],
-        'name': [
-            (r'\$.*\n', Comment.Single),
-            (r'\s+', Whitespace),
-            (r'[a-z_][a-z0-9_]*', Name.Builtin, 'before_value'),
-            (r'(\\)(\n)', bygroups(Operator, Text)),
-        ],
-        'before_value': [
-            (r'=', Punctuation, 'value'),
-            (r'\s+', Whitespace),
-            (r'.', Error, 'name')
-        ],
-        'value': [
-            (r'\$.*\n', Comment.Single, 'root'),
-            (r'\n', Text),
-            (r',', Punctuation, 'name'),
-            (r'\.!', Punctuation),
-            (r'"', String, 'string_double'),
-            (r'\'', String, 'string_single'),
-            (r'[a-z_][a-z0-9_]*', Text),
-            (r'[0-9]+(\.[0-9]+)?', Number),
-            (r'.', Text),
-        ],
-        'string_double': [
-            (r'""', String),
-            (r'"', String, 'value'),
-            (r'[^"]', String),
-        ],
-        'string_single': [
-            (r'\'\'', String),
-            (r'\'', String, 'value'),
-            (r'[^\']', String),
-        ],
-    }
-
-    _HEADER_PATTERN = re.compile(
-        r'^((\s*\$.*)\n)*file(name)?\s*=\s*[a-z_][a-z0-9_]+\s*,(\s*(\$.*)\n)*\s*suffix\s*=\s*.+',
-        re.IGNORECASE
-    )
-
-    def analyse_text(text):
-        """
-        Check for ``FILE=..., SUFFIX=...`` while ignoring comments starting with ``$``.
-        """
-        result = 0.0
-
-        if FocusMasterLexer._HEADER_PATTERN.match(text):
-            result = 0.8
-
-        assert 0.0 <= result <= 1.0
-        return result
-
-
-class FocusAccessLexer(FocusMasterLexer):
-    """
-    FOCUS access files associate segments in FOCUS master files with actual
-    tables containing data.
-
-    *New in Pygments 1.7.*
-    """
-    name = 'FOCUS access'
-    aliases = ['focus-access']
-    filenames = ['*.acx']
-    mimetypes = ['text/x-focus-access']
-
-    _HEADER_PATTERN = re.compile(
-        r'^((\s*\$.*)\n)*segment\s*=\s*[a-z_][a-z0-9_]+\s*,(\s*(\$.*)\n)*\s*tablename\s*=\s*.+',
-        re.IGNORECASE
-    )
-
-    def analyse_text(text):
-        """
-        Check for ``SEGMENT=..., TABLENAME=...`` while ignoring comments
-        starting with ``$``.
-        """
-        result = 0.0
-
-        if FocusAccessLexer._HEADER_PATTERN.match(text):
-            result = 0.8
-
-        assert 0.0 <= result <= 1.0
-        return result
-
-
-class FocusStyleSheetLexer(FocusMasterLexer):
-    """
-    Style sheet to format reports written in FOCUS.
-
-    *New in Pygments 1.7.*
-    """
-    name = 'FOCUS style sheet'
-    aliases = ['focus-style']
-    filenames = ['*.sty']
-    mimetypes = ['text/x-focus-style']
-
-    _HEADER_TYPE_PATTERN = re.compile(
-        r'^(((\s*\$)|(-\*)).*\n)*type\s*=\s*[a-z]+\s*,.+',
-        re.IGNORECASE
-    )
-    _HEADER_PAGE_DECLARATION_PATTERN = re.compile(
-        r'^(((\s*\$)|(-\*)).*\n)*(orientation|pagecolor|pagesize)\s*=\s*.+\s*,.+',
-        re.IGNORECASE
-    )
-
-    def analyse_text(text):
-        """
-        Check for ``TYPE=...,...`` or page layout declaration while
-        ignoring comments starting with ``$`` or ``-*``.
-        """
-        result = 0.0
-
-        if FocusStyleSheetLexer._HEADER_TYPE_PATTERN.match(text):
-            result = 0.7
-        elif FocusStyleSheetLexer._HEADER_PAGE_DECLARATION_PATTERN.match(text):
-            result = 0.5
-        if result > 0:
-            textStartsWithComment = text.startswith('-*') or text.lstrip().startswith('$')
-            if textStartsWithComment:
-                result += 0.2
-
-        assert 0.0 <= result <= 1.0
-        return result
-
-
 class RexxLexer(RegexLexer):
     """
     `Rexx <http://www.rexxinfo.org/>`_ is a scripting language available for

tests/examplefiles/example.acx

-$ Example FOCUS access file.
-SEGNAME=CUSTOMERS, TABLENAME = "SOME"."CUSTOMERS", KEYS =1,
- WRITE= NO,   DBSPACE = SOME.WHERE0,$

tests/examplefiles/example.fex

--* WebFOCUS test source file for pygments.
-
--* Some basic commands
--TYPE hello world!
--SET &NAME='John';
--TYPE hello &NAME !
--SET &DATETMP = DATECVT((DATEADD((DATECVT(&DATEIN, 'I8YYMD', 'YYMD')),'M', -6)),'YYMD','I8YYMD');
-
--GOTO LABEL1;
--TYPE Skip me
-
--* Label using classic syntax.
--LABEL1
-
--* Label using modern syntax.
--:LABEL2
-
--* Use FIDEL with MODIFY.
-MODIFY FILE EMPLOYEE
-CRTFORM
-  "EMPLOYEE UPDATE"
-  "EMPLOYEE ID #: <EMP_ID   LAST NAME: <LAST_NAME"
-  "DEPARTMENT: <DEPARTMENT  SALARY: <CURR_SAL"
-MATCH EMP_ID
-  ON NOMATCH REJECT
-  ON MATCH UPDATE LAST_NAME DEPARTMENT CURR_SAL
-DATA
-END
-
--* Use FIDEL with dialog manager.
--CRTFORM
--"MONTHLY SALES REPORT FOR <&CITY/10"
--"BEGINNING PRODUCT CODE IS: <&CODE1/3"
--"ENDING PRODUCT CODE IS: <&CODE2/3"
--"REGIONAL SUPERVISOR IS: <&REGIONMGR/5"
-TABLE FILE SALES
-  HEADING CENTER
-    "MONTHLY REPORT FOR &CITY"
-    "PRODUCT CODES FROM &CODE1 TO &CODE2"
-    ""
-  SUM UNIT_SOLD AND RETURNS AND COMPUTE
-  RATIO/D5.2 = 100 * RETURNS/UNIT_SOLD;
-  BY PROD_CODE
-  IF PROD_CODE IS-FROM &CODE1 TO &CODE2
-  FOOTING CENTER
-    "REGIONAL SUPERVISOR: &REGIONMGR"
-END
-
--* Aggregate and rank sort field values.
-TABLE FILE MOVIES
-  SUM WHOLESALEPR CNT.WHOLESALEPR
-  BY CATEGORY
-  RANKED BY HIGHEST 2 TOTAL AVE.WHOLESALEPR AS 'AVE.WHOLESALEPR'
-  BY RATING
-  WHERE CATEGORY EQ 'CLASSIC' OR 'FOREIGN' OR 'MUSICALS'
-END
-
--* JOIN and FILTER interaction.
-FILTER FILE EMPLOYEE CLEAR
-  NAME=XXX WHERE JOBCODE EQ 'A01'
-END
-SET FILTER = XXX IN EMPLOYEE ON
-TABLE FILE EMPLOYEE PRINT EMP_ID JOBCODE
-END
-JOIN JOBCODE IN EMPLOYEE TO JOBCODE IN JOBFILE
-FILTER FILE EMPLOYEE
-  NAME=XXX WHERE JOBCODE EQ 'A07'
-END
-TABLE FILE EMPLOYEE PRINT EMP_ID JOBCODE
-END
-SET FILTER = XXX IN EMPLOYEE ON
-TABLE FILE EMPLOYEE PRINT EMP_ID JOBCODE
-END
-JOIN CLEAR *
-TABLE FILE EMPLOYEE PRINT EMP_ID JOBCODE
-END
-
--* Use positional field reference.
-TABLE FILE CAR
-  SUM AVE.DEALER_COST
-  SUM AVE.DEALER_COST AND COMPUTE RATIO=C1/C2;
-  BY COUNTRY
-END
-
--* Calculate a simple moving average column.
-DEFINE FILE GGSALES
-  SDATE/YYM = DATE;
-  SYEAR/Y = SDATE;
-  SMONTH/M = SDATE;
-  PERIOD/I2 = SMONTH;
-END
-TABLE FILE GGSALES
-  SUM UNITS DOLLARS
-  BY CATEGORY BY PERIOD
-  WHERE SYEAR EQ 97 AND CATEGORY NE 'Gifts'
-  ON PERIOD RECAP MOVAVE/D10.1=FORECAST(DOLLARS,1,3,'MOVAVE',3);
-END
-
--* Define a function.
-DEFINE FUNCTION SUBTRACT (VAL1/D8, VAL2/D8)
-  SUBTRACT/D8.2 = VAL1 - VAL2;
-END
-
--* Totals
-TABLE FILE SALES
-  SUM RETURNS DAMAGED AND ROW-TOTAL AND COLUMN-TOTAL
-  BY PROD_CODE
-END
-
--* Use data in heading and footing.
-TABLE FILE EMPLOYEE
-  HEADING
-    "<DEPARTMENT>: BANK, EMPLOYEES AND SALARIES </1"
-    "<15 COST OF VEHICLE IS <40 <RCOST>"
-    "<10 <DIVISION <30 <AREA <50 <DATE"
-    "DAILY REPORT <DATE <+5 <LOCATION <+5 <PRODUCT"
-  PRINT CURR_SAL
-  BY DEPARTMENT NOPRINT BY BANK_ACCT
-  BY LAST_NAME BY FIRST_NAME
-  ON DEPARTMENT PAGE-BREAK
-  FOOTING
-    "<DEPARTMENT EMPLOYEES WITH ELECTRONIC TRANSFER ACCOUNTS"
-END
-
--* Long heading split up.
-TABLE FILE EMPLOYEE
-  HEADING
-    "THIS HEADING <0X
-SHOULD APPEAR <0X
-ON ONE <0X
-LINE"
-  PRINT *
-END
-
--* Real world example source code from
--* <http://www.informationbuilders.com/support/developers/dynamic_forms.html>.
--HTMLFORM CSTERM
--SET &ECHO = ALL;
--*
--* Replaces IDCAMS SYSIN
--*
-DYNAM ALLOC FILE CATCTL NEW RECFM FB -
-  LRECL 80 BLKSIZE 3120 SPACE 1,1 TRK REUSE
--*
--* Replaces IDCAMS SYSPRINT
--*
-DYNAM ALLOC FILE CATLST NEW RECFM VBA -
-  LRECL 125 BLKSIZE 27998 SPACE 2,1 TRK REUSE
--*
--* PRINT80 is a MFD used to read an 80 byte field named CONTENTS
--*
-DYNAM ALLOC FILE PRNT80 NEW RECFM FB -
-  LRECL 80 BLKSIZE 3120 SPACE 1,1 TRK REUSE
--*
--RUN
--*
--* Create the tape dataset name mask (first five nodes)
--*
--SET &CAT1 = ' LISTC LVL(' || '''' ||
--                         'PN0100.A143200.P87.P87800.STERM' || '''' || ') VOL';
--*
--WRITE CATCTL &CAT1
--*
--RUN
--*
--* Call the user written subroutine (i.e., GETCAT) to retrieve a list of tape datasets
--*
--SET &X = ' ';
--SET &X = GETCAT(&X,'A1');
--*
--* TABLE the catalog listing of tape datasets to a HOLD file
--*
-DEFINE FILE PRNT80
-  DSNAME/A44 = SUBSTR (80,CONTENTS,1,44,44,'A44');
-END
--*
-TABLE FILE PRNT80
-  PRINT DSNAME
-  ON TABLE HOLD
-END
--*
-DYNAM FREE FILE CATCTL
-DYNAM FREE FILE CATLST
-DYNAM FREE FILE PRNT80
--*
--RUN
--*
--*-----------------------------------------------------------------------
--*
--* Create the HTML drop down list
--*
-DEFINE FILE HOLD
-  NODE_POS/I3 = POSIT (DSNAME,44,'.SEM',4,'I3');
-  WHATSEM/A4 = SUBSTR (44,DSNAME,NODE_POS+4,44,4,'A4');
-  SEMWK/A2 = EDIT (WHATSEM,'$$99');
-  SEMYR/A2 = EDIT (WHATSEM,'99$$');
-  SEMESTERY2K/A6 = IF SEMYR LT '50' THEN ('20' | WHATSEM)
-    ELSE ('19' | WHATSEM);
-  D_SEM/A8 = DECODE SEMWK (03 'Spring'
-    20 'Summer 1'
-    26 'Summer 2'
-    36 'Fall'
-    ELSE 'ERROR');
-  SEMTXT/A16 = D_SEM | ' - ' | WHATSEM;
--* Create the dynamic html for the drop down list
-  SEMESTER/A50 = '<option value="' ||WHATSEM|| '">' ||SEMTXT|| '</option>';
-END
--*
-TABLE FILE HOLD
-  SUM SEMESTER
--* Want the most recent semester first
-  BY HIGHEST SEMESTERY2K NOPRINT
-  ON TABLE SET HOLDLIST PRINTONLY
-  ON TABLE HOLD AS HOLDSEMS
-END
--*
--RUN
--*
--*-----------------------------------------------------------------------
--*
--SET &SPACE = '&' || 'nbsp;';
--*
--* Display the HTML form to allow users to select semester/cycle
--*
--HTMLFORM CSTERM

tests/examplefiles/example.mas

-$ Example FOCUS master file.
-FILE=CENTGL, SUFFIX=FOC
-SEGNAME=ACCOUNTS,SEGTYPE = S01
-FIELDNAME=GL_ACCOUNT,           ALIAS=GLACCT,  FORMAT=A7,
-          TITLE='Ledger,Account', FIELDTYPE=I, $
-FIELDNAME=GL_ACCOUNT_PARENT,    ALIAS=GLPAR,   FORMAT=A7,
-          TITLE=Parent,
-          PROPERTY=PARENT_OF, REFERENCE=GL_ACCOUNT, $
-FIELDNAME=GL_ACCOUNT_TYPE,      ALIAS=GLTYPE,  FORMAT=A1,
-          TITLE=Type,$
-
-FIELDNAME=GL_ROLLUP_OP,         ALIAS=GLROLL,  FORMAT=A1,
-          TITLE=Op, $ Some comment.
-FIELDNAME=GL_ACCOUNT_LEVEL,     ALIAS=GLLEVEL, FORMAT=I3,
-          TITLE=Lev, $
-    $ Another comment.
-FIELDNAME=GL_ACCOUNT_CAPTION,   ALIAS=GLCAP,   FORMAT=A30,
-          TITLE=Caption,
-          PROPERTY=CAPTION,   REFERENCE=GL_ACCOUNT, $
-FIELDNAME=SYS_ACCOUNT,          ALIAS=ALINE,   FORMAT=A6,
-          TITLE='System,Account,Line', MISSING=ON, $

tests/examplefiles/example.sty

-$ Example WebFOCUS style sheet.
--* A FOCUS comment.
-TYPE=REPORT, PAGESIZE=A4, Orientation = LANDSCAPE, $
-TYPE=HEADING, FONT='Helvetica',
-  SIZE=14, STYLE=BOLD, $ another comment
-
-PAGECOLOR=blue, $
-
-TYPE=HEADING, OBJECT=TEXT, ITEM=2, COLOR=BLUE, SIZE=12,
-     STYLE=BOLD+UNDERLINE, $

tests/test_basic_api.py

         if cls.name in ['XQuery', 'Opa']:   # XXX temporary
             return
 
-        tokens = list(inst.get_tokens(test_content))
+        try:
+            tokens = list(inst.get_tokens(test_content))
+        except KeyboardInterrupt:
+            raise KeyboardInterrupt('interrupted %s.get_tokens(): test_content=%r' % (cls.__name__, test_content))
         txt = ""
         for token in tokens:
             assert isinstance(token, tuple)

tests/test_lexers_other.py

 import unittest
 
 from pygments.lexers import guess_lexer
-from pygments.lexers.other import EasytrieveLexer, JclLexer, RexxLexer, \
-    WebFocusLexer
-
+from pygments.lexers.other import EasytrieveLexer, JclLexer, RexxLexer
 
 def _exampleFilePath(filename):
     return os.path.join(os.path.dirname(__file__), 'examplefiles', filename)