Matthew Pickering pushed to branch wip/romes/ast-ohne-faststring at Glasgow Haskell Compiler / GHC

Commits:

4 changed files:

Changes:

  • compiler/GHC/Data/FastString.hs
    ... ... @@ -558,7 +558,7 @@ mkFastStringShortByteString sbs =
    558 558
     
    
    559 559
     -- | Create a UTF-8 encoded 'FastString' from a 'Text'
    
    560 560
     mkFastStringText :: T.Text -> FastString
    
    561
    -mkFastStringText = mkFastStringByteString . T.encodeUtf8
    
    561
    +mkFastStringText = mkFastString . T.unpack
    
    562 562
     
    
    563 563
     -- | Creates a UTF-8 encoded 'FastString' from a 'String'
    
    564 564
     mkFastString :: String -> FastString
    

  • testsuite/tests/parser/should_run/StringStartsWithNull.hs
    1
    +module Main where
    
    2
    +
    
    3
    +main :: IO ()
    
    4
    +main = print "\0a"

  • testsuite/tests/parser/should_run/StringStartsWithNull.stdout
    1
    +"\NULa"

  • testsuite/tests/parser/should_run/all.T
    ... ... @@ -20,6 +20,7 @@ test('HexFloatLiterals', normal, compile_and_run, [''])
    20 20
     test('NumericUnderscores0', normal, compile_and_run, [''])
    
    21 21
     test('NumericUnderscores1', normal, compile_and_run, [''])
    
    22 22
     test('LexNegLit', normal, compile_and_run, [''])
    
    23
    +test('StringStartsWithNull', normal, compile_and_run, [''])
    
    23 24
     test('RecordDotSyntax1', normal, compile_and_run, [''])
    
    24 25
     test('RecordDotSyntax2', normal, compile_and_run, [''])
    
    25 26
     test('RecordDotSyntax3', [extra_files(['RecordDotSyntaxA.hs'])], multimod_compile_and_run, ['RecordDotSyntax3', ''])