Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Hashbang

Objective

The objective of this feature is to allow Modula-2 program sources to conform to the Hashbang or Shebang convention on Unix operating systems.

Hashbang convention

On Unix like operating systems, the program loader considers any text file whose first two characters are #! (called Hashbang or Shebang) to be an executable script. The program loader interprets the character sequence following the hashbang as a pathname to the interpreter that can interpret and execute the script. It will then try to invoke the interpreter specified in the path and pass the script as an argument.

Lexer Requirement

Any Modula-2 lexer shall examine the first two characters of the first line of a Modula-2 program source file and if they are # and ! respectively then it shall ignore the first line of the file entirely and begin lexing the file in the second line instead.