<commit_before>-----------------------------------------------------------------------------
-- GHC Driver program
--
-- (c) <NAME> 2000
--
-----------------------------------------------------------------------------

module Main (main) where

import Package
import Config

import RegexString
import Concurrent
import Posix
import IOExts
import Exception
import Dynamic

import IO
import Array
import List
import System
import Maybe
import Char

#define GLOBAL_VAR(name,value,ty)  \
name = global (value) :: IORef (ty); \
{-# NOINLINE name #-}

-----------------------------------------------------------------------------
-- ToDo:

-- time commands when run with -v
-- split marker
-- mkDLL
-- java generation
-- user ways
-- Win32 support
-- make sure OPTIONS in .hs file propogate to .hc file if -C or -keep-hc-file-too

-----------------------------------------------------------------------------
-- Differences vs. old driver:

-- No more "Enter your Haskell program, end with ^D (on a line of its own):"
-- consistency checking removed (may do this properly later)
-- removed -noC
-- no hi diffs (could be added later)
-- no -Ofile

-----------------------------------------------------------------------------
-- non-configured things

_Haskell1Version = "5" -- i.e., Haskell 98

-----------------------------------------------------------------------------
-- Usage Message

short_usage = do
  hPutStr stderr "\nUsage: For basic information, try the `-help' option.\n"
  exitWith ExitSuccess
   
long_usage = do
  let usage_dir = findFile "ghc-usage.txt" (cGHC_DRIVER_DIR++"/ghc-usage.txt")
  usage <- readFile (usage_dir++"/ghc-usage.txt")
  dump usage
  exitWith ExitSuccess
  where
     dump "" = return ()
     dump ('$':'$':s) = hPutStr stderr get_prog_name >> dump s
     dump (c:s) = hPutChar stderr c >> dump s

version_str = cProjectVersion ++ 
		( if cProjectPatchLevel /= "0" && cProjectPatchLevel /= ""
			then '.':cProjectPatchLevel
			else "")

-----------------------------------------------------------------------------
-- Phases

{-
Phase of the           | Suffix saying | Flag saying   | (suffix of)
compilation system     | ``start here''| ``stop after''| output file

literate pre-processor | .lhs          | -             | -
C pre-processor (opt.) | -             | -E            | -
Haskell compiler       | .hs           | -C, -S        | .hc, .s
C compiler (opt.)      | .hc or .c     | -S            | .s
assembler              | .s  or .S     | -c            | .o
linker                 | other         | -             | a.out
-}

data Phase 
	= MkDependHS	-- haskell dependency generation
	| Unlit<commit_msg>[project @ 2000-06-29 20:20:18 by panne] Fixed buglet in search for ghc-usage.txt<commit_after>-----------------------------------------------------------------------------
-- GHC Driver program
--
-- (c) <NAME> 2000
--
-----------------------------------------------------------------------------

module Main (main) where

import Package
import Config

import RegexString
import Concurrent
import Posix
import IOExts
import Exception
import Dynamic

import IO
import Array
import List
import System
import Maybe
import Char

#define GLOBAL_VAR(name,value,ty)  \
name = global (value) :: IORef (ty); \
{-# NOINLINE name #-}

-----------------------------------------------------------------------------
-- ToDo:

-- time commands when run with -v
-- split marker
-- mkDLL
-- java generation
-- user ways
-- Win32 support
-- make sure OPTIONS in .hs file propogate to .hc file if -C or -keep-hc-file-too

-----------------------------------------------------------------------------
-- Differences vs. old driver:

-- No more "Enter your Haskell program, end with ^D (on a line of its own):"
-- consistency checking removed (may do this properly later)
-- removed -noC
-- no hi diffs (could be added later)
-- no -Ofile

-----------------------------------------------------------------------------
-- non-configured things

_Haskell1Version = "5" -- i.e., Haskell 98

-----------------------------------------------------------------------------
-- Usage Message

short_usage = do
  hPutStr stderr "\nUsage: For basic information, try the `-help' option.\n"
  exitWith ExitSuccess
   
long_usage = do
  let usage_filename = "ghc-usage.txt"
      usage_dir = findFile usage_filename cGHC_DRIVER_DIR
  usage <- readFile (usage_dir ++ "/" ++ usage_filename)
  dump usage
  exitWith ExitSuccess
  where
     dump "" = return ()
     dump ('$':'$':s) = hPutStr stderr get_prog_name >> dump s
     dump (c:s) = hPutChar stderr c >> dump s

version_str = cProjectVersion ++ 
		( if cProjectPatchLevel /= "0" && cProjectPatchLevel /= ""
			then '.':cProjectPatchLevel
			else "")

-----------------------------------------------------------------------------
-- Phases

{-
Phase of the           | Suffix saying | Flag saying   | (suffix of)
compilation system     | ``start here''| ``stop after''| output file

literate pre-processor | .lhs          | -             | -
C pre-processor (opt.) | -             | -E            | -
Haskell compiler       | .hs           | -C, -S        | .hc, .s
C compiler (opt.)      | .hc or .c     | -S            | .s
assembler              | .s  or .S     | -c            | .o
linker                 | other         | -             | a.out
-}

data Phase 
	= MkDependHS	-- haskell dependency generation
	| Unlit
{'fraction_non_alphanumeric': 0.29660545353366724, 'fraction_numerical': 0.00667779632721202, 'mean_word_length': 1.228099173553719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105334', 'n_tokens_mistral': 1490, 'n_tokens_neox': 1413, 'n_words': 482}