Skip to content

Fix duplicate END check in ComponentPascalLexer.analyse_text#3032

Open
daniel7an wants to merge 1 commit intopygments:masterfrom
daniel7an:fix/issue-3028-component-pascal-analyse
Open

Fix duplicate END check in ComponentPascalLexer.analyse_text#3032
daniel7an wants to merge 1 commit intopygments:masterfrom
daniel7an:fix/issue-3028-component-pascal-analyse

Conversation

@daniel7an
Copy link

Summary

Fix the duplicate 'END' in text check in ComponentPascalLexer.analyse_text.

Problem

The analyse_text method checks for 'END' twice (lines 114 and 118), making the second check redundant. This means the method awards +0.02 for END but only +0.01 for BEGIN and PROCEDURE, which is unintentional.

Fix

Replace the second 'END' check with 'MODULE', since Component Pascal programs are structured as MODULE ... END blocks, making it a natural and distinctive keyword to check for.

Fixes #3028

The analyse_text method checked for 'END' twice, making the second
check redundant. Replace the duplicate with 'MODULE', which is another
common Component Pascal keyword (programs are wrapped in MODULE...END).

Fixes pygments#3028
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Component Pascal analyse_text logic

1 participant