Changes between Initial Version and Version 2 of Ticket #3921


Ignore:
Timestamp:
Apr 28, 2010 9:28:21 PM (4 years ago)
Author:
igloo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3921

    • Property Cc lonetiger@… added
  • Ticket #3921 – Description

    initial v2  
    22 
    33A simple example would be 
    4  
     4{{{ 
    55module Main where 
    66 
     
    99main :: IO () 
    1010main = return () 
    11  
     11}}} 
    1212which does nothing really, but should compile. 
    1313 
    1414this fails under linux (when the file was saved using windows line endings) with the error  
    15  
     15{{{ 
    16161.Broken.hsc:4: error: expected identifier or ‘(’ before ‘)’ token 
    17172.compiling Broken_hsc_make.c failed 
    18  
     18}}} 
    1919looking at the generated .c file 
    20  
     20{{{ 
    21214.#include "/usr/lib/ghc-6.12.1/template-hsc.h" 
    22225.#line 3 "Broken.hsc" 
     
    24247.); 
    25258.  <truncated> 
    26  
     26}}} 
    2727on line 6 the closing ");" was pushed to a new line, 7, but this causes the define to end unexpectedly and cauzes the syntax error mention above. This is presumably because only the "\n" and the "\r" are left in there. 
    2828 
    2929also the generated code contains a mixture of both endings, which is no problem for ghc and gcc but might be for some editors: 
    30  
     30{{{ 
    313118.    fputs ("\r\n" 
    323219.           "", stdout); 
    333320.    fputs ("\n" 
    343421.           "", stdout); 
     35}}}