on master help sign in
Merge pull request #4095 from asandroq/fix-flag-argument-order
eabb922Ahmad Salim Al-Sibahi
CHANGELOG.md+2
@@ -19,6 +19,8 @@
19+ Private functions are no longer visible in the REPL except for modules
19+ Private functions are no longer visible in the REPL except for modules
20 that are explicitly loaded.
20 that are explicitly loaded.
21+ The --interface option now creates CommonJS modules on the node backend.
21+ The --interface option now creates CommonJS modules on the node backend.
22++ The C backend now pass arguments to the C compiler in the same order
23+ as they were given in the source files.
22
24
23# New in 1.1.1
25# New in 1.1.1
24
26
CONTRIBUTORS+1
@@ -8,6 +8,7 @@ Adolfo Ochagavía
8Ahmad Salim Al-Sibahi
8Ahmad Salim Al-Sibahi
9Aistis Raulinaitis
9Aistis Raulinaitis
10Alex Feldman-Crough
10Alex Feldman-Crough
11+Alex S. Queiroz e Silva
11Alexander Berntsen
12Alexander Berntsen
12Alexander Shabalin
13Alexander Shabalin
13Alyssa Carter
14Alyssa Carter
src/Idris/AbsSyntax.hs+3−3
@@ -58,19 +58,19 @@ getObjectFiles :: Codegen -> Idris [FilePath]
58getObjectFiles tgt = do i <- getIState; return (forCodegen tgt $ idris_objs i)
58getObjectFiles tgt = do i <- getIState; return (forCodegen tgt $ idris_objs i)
59
59
60addObjectFile :: Codegen -> FilePath -> Idris ()
60addObjectFile :: Codegen -> FilePath -> Idris ()
61−addObjectFile tgt f = do i <- getIState; putIState $ i { idris_objs = nub $ (tgt, f) : idris_objs i }
61+addObjectFile tgt f = do i <- getIState; putIState $ i { idris_objs = nub $ idris_objs i ++ [(tgt, f)] }
62
62
63getLibs :: Codegen -> Idris [String]
63getLibs :: Codegen -> Idris [String]
64getLibs tgt = do i <- getIState; return (forCodegen tgt $ idris_libs i)
64getLibs tgt = do i <- getIState; return (forCodegen tgt $ idris_libs i)
65
65
66addLib :: Codegen -> String -> Idris ()
66addLib :: Codegen -> String -> Idris ()
67−addLib tgt f = do i <- getIState; putIState $ i { idris_libs = nub $ (tgt, f) : idris_libs i }
67+addLib tgt f = do i <- getIState; putIState $ i { idris_libs = nub $ idris_libs i ++ [(tgt, f)] }
68
68
69getFlags :: Codegen -> Idris [String]
69getFlags :: Codegen -> Idris [String]
70getFlags tgt = do i <- getIState; return (forCodegen tgt $ idris_cgflags i)
70getFlags tgt = do i <- getIState; return (forCodegen tgt $ idris_cgflags i)
71
71
72addFlag :: Codegen -> String -> Idris ()
72addFlag :: Codegen -> String -> Idris ()
73−addFlag tgt f = do i <- getIState; putIState $ i { idris_cgflags = nub $ (tgt, f) : idris_cgflags i }
73+addFlag tgt f = do i <- getIState; putIState $ i { idris_cgflags = nub $ idris_cgflags i ++ [(tgt, f)] }
74
74
75addDyLib :: [String] -> Idris (Either DynamicLib String)
75addDyLib :: [String] -> Idris (Either DynamicLib String)
76addDyLib libs = do i <- getIState
76addDyLib libs = do i <- getIState
test/TestData.hs+2−1
@@ -87,7 +87,8 @@ testFamiliesData = [
87 [ ( 1, ANY )]),
87 [ ( 1, ANY )]),
88 ("directives", "Directives",
88 ("directives", "Directives",
89 [ ( 1, ANY ),
89 [ ( 1, ANY ),
90− ( 2, ANY )]),
90+ ( 2, ANY ),
91+ ( 3, C_CG )]),
91 ("disambig", "Disambiguation",
92 ("disambig", "Disambiguation",
92 [ ( 2, ANY )]),
93 [ ( 2, ANY )]),
93 ("docs", "Documentation",
94 ("docs", "Documentation",
test/directives003/directives003.idrnew file+11
@@ -0,0 +1,11 @@
1+module directives003
2+
3+-- names are randomly generated so as to avoid existing names
4+%lib C "nuyahcha"
5+%lib C "mohgiide"
6+%lib C "apeekair"
7+%flag C "-Wl,-leeraimam -Wl,-lrahhahwi -Wl,-lgoocheiv"
8+
9+namespace Main
10+ main : IO ()
11+ main = putStrLn "Hello, World!"
test/directives003/expectednew file+6
@@ -0,0 +1,6 @@
1+nuyahcha
2+mohgiide
3+apeekair
4+eeraimam
5+rahhahwi
6+goocheiv
test/directives003/runnew file+13
@@ -0,0 +1,13 @@
1+#!/usr/bin/env bash
2+
3+# %lib C "nuyahcha"
4+# %lib C "mohgiide"
5+# %lib C "apeekair"
6+# %flag C "-Wl,-leeraimam -Wl,-lrahhahwi -Wl,-lgoocheiv"
7+
8+${IDRIS:-idris} $@ -o directives003 directives003.idr \
9+ | tr ' ,"' '\n' \
10+ | sed 's/-l//' \
11+ | grep -E 'nuyahcha|mohgiide|apeekair|eeraimam|rahhahwi|goocheiv'
12+
13+rm -f directives003 *.ibc