mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
bugfix: don't process arguments that are to be passed to the produced exe
This commit is contained in:
@@ -37,17 +37,18 @@ proc ProcessCmdLine(pass: TCmdLinePass) =
|
||||
ProcessSwitch(key, val, pass, gCmdLineInfo)
|
||||
else:
|
||||
ProcessSwitch(p.key, p.val, pass, gCmdLineInfo)
|
||||
of cmdArgument:
|
||||
if pass == passCmd1:
|
||||
if options.command == "":
|
||||
options.command = p.key
|
||||
else:
|
||||
options.commandArgs.add p.key
|
||||
of cmdArgument:
|
||||
if pass != passCmd1: break
|
||||
if options.command == "":
|
||||
options.command = p.key
|
||||
else:
|
||||
options.commandArgs.add p.key
|
||||
|
||||
if options.gProjectName == "":
|
||||
# support UNIX style filenames anywhere for portable build scripts:
|
||||
options.gProjectName = unixToNativePath(p.key)
|
||||
arguments = cmdLineRest(p)
|
||||
if options.gProjectName == "":
|
||||
# support UNIX style filenames anywhere for portable build scripts:
|
||||
options.gProjectName = unixToNativePath(p.key)
|
||||
arguments = cmdLineRest(p)
|
||||
break
|
||||
|
||||
if pass == passCmd2:
|
||||
if optRun notin gGlobalOptions and arguments != "":
|
||||
|
||||
@@ -265,7 +265,8 @@ type
|
||||
# current document.
|
||||
# This is for single underline adornments.
|
||||
overlineToLevel*: TLevelMap # Saves for each possible title adornment
|
||||
# character its level in the current document.
|
||||
# character its level in the current
|
||||
# document.
|
||||
# This is for over-underline adornments.
|
||||
|
||||
PSharedState = ref TSharedState
|
||||
@@ -819,8 +820,8 @@ proc parseComment(p: var TRstParser): PRstNode =
|
||||
|
||||
type
|
||||
TDirKind = enum # must be ordered alphabetically!
|
||||
dkNone, dkAuthor, dkAuthors, dkCodeBlock, dkContainer, dkContents, dkFigure,
|
||||
dkImage, dkInclude, dkIndex, dkRaw, dkTitle
|
||||
dkNone, dkAuthor, dkAuthors, dkCodeBlock, dkContainer, dkContents,
|
||||
dkFigure, dkImage, dkInclude, dkIndex, dkRaw, dkTitle
|
||||
|
||||
const
|
||||
DirIds: array[0..11, string] = ["", "author", "authors", "code-block",
|
||||
@@ -1103,7 +1104,7 @@ proc parseSimpleTable(p: var TRstParser): PRstNode =
|
||||
getColumns(p, cols)
|
||||
setlen(row, len(cols))
|
||||
if a != nil:
|
||||
for j in countup(0, rsonsLen(a) - 1): a.sons[j].kind = rnTableHeaderCell
|
||||
for j in 0..rsonsLen(a)-1: a.sons[j].kind = rnTableHeaderCell
|
||||
if p.tok[p.idx].kind == tkEof: break
|
||||
for j in countup(0, high(row)): row[j] = ""
|
||||
# the following while loop iterates over the lines a single cell may span:
|
||||
@@ -1236,8 +1237,8 @@ proc parseDefinitionList(p: var TRstParser): PRstNode =
|
||||
if (p.tok[p.idx].kind == tkIndent) and (p.tok[p.idx].ival == col):
|
||||
inc(p.idx)
|
||||
j = tokenAfterNewLine(p) - 1
|
||||
if (j >= 1) and (p.tok[j].kind == tkIndent) and (p.tok[j].ival > col) and
|
||||
(p.tok[j - 1].symbol != "::") and (p.tok[j + 1].kind != tkIndent):
|
||||
if j >= 1 and p.tok[j].kind == tkIndent and p.tok[j].ival > col and
|
||||
p.tok[j-1].symbol != "::" and p.tok[j+1].kind != tkIndent:
|
||||
nil
|
||||
else:
|
||||
break
|
||||
|
||||
@@ -349,8 +349,7 @@ input management. To start Nimrod in interactive mode use the command
|
||||
``nimrod i``. To quit use the ``quit()`` command. To determine whether an input
|
||||
line is an incomplete statement to be continued these rules are used:
|
||||
|
||||
1. The line ends with ``[-+*/\\<>!\?\|%&$@~,;:=#^]\s*$`` (operator symbol
|
||||
followed by optional whitespace).
|
||||
1. The line ends with ``[-+*/\\<>!\?\|%&$@~,;:=#^]\s*$`` (operator symbol followed by optional whitespace).
|
||||
2. The line starts with a space (indentation).
|
||||
3. The line is within a triple quoted string literal. However, the detection
|
||||
does not work if the line contains more than one ``"""``.
|
||||
@@ -402,6 +401,12 @@ However it is not efficient to do:
|
||||
.. code-block:: Nimrod
|
||||
var s = varA # assignment has to copy the whole string into a new buffer!
|
||||
|
||||
For ``let`` symbols a copy is not always necessary:
|
||||
|
||||
.. code-block:: Nimrod
|
||||
let s = varA # may only copy a pointer if it safe to do so
|
||||
|
||||
|
||||
The compiler optimizes string case statements: A hashing scheme is used for them
|
||||
if several different string constants are used. So code like this is reasonably
|
||||
efficient:
|
||||
|
||||
@@ -134,6 +134,8 @@ if [ $# -eq 1 ] ; then
|
||||
chmod 644 $docdir/tut2.txt
|
||||
cp doc/intern.html $docdir/intern.html || exit 1
|
||||
chmod 644 $docdir/intern.html
|
||||
cp doc/manual.html $docdir/manual.html || exit 1
|
||||
chmod 644 $docdir/manual.html
|
||||
cp doc/nimrodc.html $docdir/nimrodc.html || exit 1
|
||||
chmod 644 $docdir/nimrodc.html
|
||||
cp doc/mytest.cfg $docdir/mytest.cfg || exit 1
|
||||
@@ -242,6 +244,8 @@ if [ $# -eq 1 ] ; then
|
||||
chmod 644 $libdir/pure/encodings.nim
|
||||
cp lib/pure/events.nim $libdir/pure/events.nim || exit 1
|
||||
chmod 644 $libdir/pure/events.nim
|
||||
cp lib/pure/ftpclient.nim $libdir/pure/ftpclient.nim || exit 1
|
||||
chmod 644 $libdir/pure/ftpclient.nim
|
||||
cp lib/pure/gentabs.nim $libdir/pure/gentabs.nim || exit 1
|
||||
chmod 644 $libdir/pure/gentabs.nim
|
||||
cp lib/pure/hashes.nim $libdir/pure/hashes.nim || exit 1
|
||||
|
||||
Reference in New Issue
Block a user