Merge branch 'tools' into wip
authorJean Privat <jean@pryen.org>
Thu, 5 Jan 2012 12:10:21 +0000 (07:10 -0500)
committerJean Privat <jean@pryen.org>
Thu, 5 Jan 2012 12:10:21 +0000 (07:10 -0500)
16 files changed:
Makefile
bin/gccx
c_src/environ_nit.h
c_src/exec_nit.h
lib/opts.nit
lib/standard/environ.nit
lib/standard/environ_nit.h
lib/standard/exec_nit.h
lib/standard/time.nit
src/git-gen-version.sh
src/icode/icode.nit
src/icode/icode_tools.nit
src/mmloader.nit
src/nc
src/parser/Makefile
src/showerr.sh

index fa95668..d96989b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,14 +23,14 @@ bin/nitc: c_src/nitc src/parser/parser.nit
        @echo '* Compile nitc from NIT source files                          *'
        @echo '***************************************************************'
        src/git-gen-version.sh
-       c_src/nitc ${NITCOPT} --clibdir c_src/clib -o bin/nitc -O -v src/nitc.nit
+       cd src; ../c_src/nitc ${NITCOPT} --clibdir ../c_src/clib -o ../bin/nitc -O -v nitc.nit
 
 bin/nitdoc: bin/nitc
        @echo '***************************************************************'
        @echo '* Compile nitdoc from NIT source files                        *'
        @echo '***************************************************************'
        src/git-gen-version.sh
-       bin/nitc ${NITCOPT} -o bin/nitdoc -O -v src/nitdoc.nit
+       cd src; ../bin/nitc ${NITCOPT} -o ../bin/nitdoc -O -v nitdoc.nit
 
 doc/stdlib/index.html: bin/nitdoc
        @echo '***************************************************************'
index 4ec4d8c..83f8c9f 100755 (executable)
--- a/bin/gccx
+++ b/bin/gccx
@@ -19,7 +19,7 @@
 
 OPTS="-g" # option for compiler call
 objs="" # List of .o files
-CC="gcc --ansi --pedantic -Wall -Wextra -Wformat-security -Wcast-align -Wno-uninitialized -Wno-unused-variable -Wno-unused-label -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-unused-but-set-variable" # Default compiler call
+CC="cc" # Default compiler call
 ext="_savo _sav" # Default flavor to reuse
 out="a.out"  # Default output binary filename
 dir="" # Default tmp dir
index 221286c..18478cf 100644 (file)
@@ -13,7 +13,6 @@
  * another product.
  */
 
-#define _POSIX_C_SOURCE 1
 #include <stdlib.h>
 
 #define string_NativeString_NativeString_get_environ_0(self) getenv(self)
index a0c8352..93caf0c 100644 (file)
@@ -14,7 +14,6 @@
  * another product.
  */
 
-#define _POSIX_C_SOURCE 1
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
index 59391cd..1d085b8 100644 (file)
@@ -11,6 +11,9 @@
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 # another product.
 
+# Manage options on the command line
+module opts
+
 # Super class of all option's class
 class Option
        # Names for the option (including long and short ones)
index 80afabe..9c584de 100644 (file)
@@ -11,6 +11,7 @@
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 # another product.
 
+# Acces of the environement variables of the process
 import symbol
 
 # TODO prevoir une structure pour recup tout un environ, le modifier et le passer a process
index 10633ef..9fdc203 100644 (file)
@@ -13,7 +13,6 @@
  * another product.
  */
 
-#define _POSIX_C_SOURCE 1
 #include <stdlib.h>
 
 #define string_NativeString_NativeString_get_environ_0(self) getenv(self)
index ec3efd4..7c7659d 100644 (file)
@@ -14,7 +14,6 @@
  * another product.
  */
 
-#define _POSIX_C_SOURCE 1
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
index a1f3424..195157f 100644 (file)
@@ -10,6 +10,7 @@
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 # another product.
 
+# Manage time and dates
 package time
 
 import kernel
index b21d8bb..e018dc6 100755 (executable)
@@ -20,7 +20,9 @@
 # The version number is stored in a dedicated Nit module.
 
 gen_version() {
-       if ! grep "$*" nit_version.nit >/dev/null 2>&1; then
+       if grep "$*" nit_version.nit >/dev/null 2>&1; then
+               :
+       else
                cat > nit_version.nit<<END
 # This file was generated by git-gen-version.sh
 package nit_version
@@ -40,7 +42,7 @@ if [ ! -f nitc.nit ]; then
        fi
 fi
 
-VN=$(git describe --always HEAD 2>/dev/null)
+VN=`git describe --always HEAD 2>/dev/null`
 if [ "$?" != "0" ]; then
        if [ -r ../VERSION ]; then
                VN="$(cat ../VERSION)"
index ec6ddbf..0c6fcce 100644 (file)
@@ -15,6 +15,7 @@
 # limitations under the License.
 
 # Nit intermediate code representation
+module icode
 import icode_base
 import icode_tools
 import icode_builder
index 6316748..ff2b2e8 100644 (file)
@@ -15,6 +15,7 @@
 # limitations under the License.
 
 # Tools to manipulate intermediace nit code representation
+module icode_tools
 import icode_builder
 
 # A simple visitor to visit icode structures
index 919099f..9d28ff2 100644 (file)
@@ -69,7 +69,6 @@ class Message
                        while line_end+1 < string.length and string[line_end+1] != '\n' and string[line_end+1] != '\r' do
                                line_end += 1
                        end
-                       print "{i-1}: {line_start} && {line_end}"
                        var lstart = string.substring(line_start, location.column_start - 1)
                        var cend
                        if i != location.line_end then
diff --git a/src/nc b/src/nc
index 9672e88..8a382c0 100755 (executable)
--- a/src/nc
+++ b/src/nc
 
 NITC="../c_src/nitc"
 NITCOPTS="-v -W"
-CSRC=$( (cd ../c_src; pwd) )
+CSRC=$` (cd ../c_src; pwd) `
 
 trap_action() {
-       test -n $sub_command && kill $sub_command
-       test -e $pipe && rm -f $pipe
+       test -n "$sub_command" && kill $sub_command
+       test -e "$pipe" && rm -f $pipe
        exit 1
 }
 
@@ -39,8 +39,8 @@ esac
 
 trap trap_action INT TERM
 echo ${NITC} ${NITCOPTS} ${opts} "$@"
-pipe=$(mktemp nc.stderr.XXXXX)
-rm "$pipe"
+pipe=$`mktemp nc.stderr.XXXXX`
+rm "$pipe" 2>/dev/null
 mkfifo "$pipe"
 ./showerr.sh <"$pipe" &
 sub_command=$!
index 074facf..5115297 100644 (file)
@@ -27,7 +27,7 @@ parser.nit: .nit.sablecc3 xss/*.xss
        ${SABLECC} -c .nit.sablecc3.dump -t xss/main.xss -p usermodule parser_nodes .nit.sablecc3
        mv -f -- parser.nit .parser-nofact.nit
        ./fact_parser.pl .parser-nofact.nit > parser.nit
-       LANG=C sed -i.orig -e 's/\([ \[]\)P\([A-Z]\)/\1A\2/g' parser.nit parser_abs.nit parser_prod.nit lexer.nit
+       perl -np -i.orig -e 's/([ \[])P([A-Z])/\1A\2/g' parser.nit parser_abs.nit parser_prod.nit lexer.nit
 
 clean:
        rm -f -- .nit.sablecc3 .nit.sablecc3.dump .parser-nofact.nit || true
index 831acca..db057e5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # This file is part of NIT ( http://www.nitlanguage.org ).
 #
 # Copyright 2008 Jean Privat <jean@pryen.org>