@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 '***************************************************************'
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
* another product.
*/
-#define _POSIX_C_SOURCE 1
#include <stdlib.h>
#define string_NativeString_NativeString_get_environ_0(self) getenv(self)
* another product.
*/
-#define _POSIX_C_SOURCE 1
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
# 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)
# 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
* another product.
*/
-#define _POSIX_C_SOURCE 1
#include <stdlib.h>
#define string_NativeString_NativeString_get_environ_0(self) getenv(self)
* another product.
*/
-#define _POSIX_C_SOURCE 1
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
# 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
# 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
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)"
# limitations under the License.
# Nit intermediate code representation
+module icode
import icode_base
import icode_tools
import icode_builder
# limitations under the License.
# Tools to manipulate intermediace nit code representation
+module icode_tools
import icode_builder
# A simple visitor to visit icode structures
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
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
}
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=$!
${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
-#!/bin/sh
+#!/bin/bash
# This file is part of NIT ( http://www.nitlanguage.org ).
#
# Copyright 2008 Jean Privat <jean@pryen.org>