bugModula-2 Compiler and Translator - Bugs: bug #44787, Existence of a lowercase mode is a...

 
 

bug #44787: Existence of a lowercase mode is a bug

Submitter:  None
Submitted:  Thu 09 Apr 2015 06:40:43 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 30 Apr 2015 10:39:43 PM UTC, comment #3: 

Correction about pre-preprocessing. I meant the code processor that was mentioned.

David Egan Evans <sinuhe>
Group administrator
Thu 30 Apr 2015 10:33:38 PM UTC, comment #2: 

First, upper case is not for cheap syntax highlighting. It is for avoiding statement collisions from existing source texts, (Pascal originally only used upper-case letters, to be compatible with the restricted ASCII character set used on the CDC 6000), and keeps out of the way of user-defined variable, procedure, and module names (which are rarely upper-case).

As for lower-case being used for reserved words, I agree with you about using pre-processing. I think removing -upper-case, and making -strict the default, instead of preserving -upper-case as an extension, is the right thing to do.

David Egan Evans <sinuhe>
Group administrator
Thu 09 Apr 2015 06:44:55 AM UTC, comment #1: 

"multi-protocol" is a freudian error, it should be "multi-dialect".

Anonymous
Thu 09 Apr 2015 06:40:43 AM UTC, original submission:  

Modula-2 does not permit lowercase reserved words. There is a reason why reserved words are uppercased. It is a form of stropping and a reminiscent of Modula-2's Algol heritage. Uppercase in Modula-2 means boldface just as stropping in Algol meant boldface. It is an encoding of boldface in plain text source files.

The benefit of encoding reserved words in this way is to guarantee that language extensions that introduce additional reserved words or predefined identifiers will not clash with user defined identifiers as long as user defined identifiers follow to the convention not to use all-uppercase. It also improves readability.

For this reason, any Modula-2 compiler/translator that offers lowercase reserved word recognition is violating the primary design philosophy of the language. No matter how one looks at it, this can only be considered a bug. It cannot possibly be seen as a feature.

This is a serious bug because it can break user defined source code. This bug should be fixed by removing the lowercase mode from the compiler altogether.

The correct way to go about showing reserved words and predefined identifiers in lowercase is by way of a source code processor that renders reserved words and predefined identifiers in lowercase boldface (or underlined or otherwise highlighted).

The Pygments source code rendering framework contains a multi-protocol capable plug-in for Modula-2 which allows rendering in Algol mode, where reserved words are rendered in lowercase boldface (optionally underlined) and predefined identifiers in lowercase boldface italic, following the style of the Revised Algol Report from 1963 which has since set a de-facto standard still followed to this day in scholarly papers. Anyone who would like to see their M2 sources with lowercase reserved words and predefined identifiers should use such a renderer.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sinuhe (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-30 sinuhe StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code