mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 18:02:25 +00:00
Honour file path in showdef module argument.
This commit is contained in:
parent
240885d841
commit
13da50007e
1 changed files with 9 additions and 9 deletions
|
|
@ -256,6 +256,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver
|
||||||
BEGIN i := 0;
|
BEGIN i := 0;
|
||||||
WHILE name[i] # 0X DO INC(i) END;
|
WHILE name[i] # 0X DO INC(i) END;
|
||||||
WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END;
|
WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END;
|
||||||
|
IF i > 0 THEN name[i] := 0X; Files.SetSearchPath(name) END;
|
||||||
INC(i); j := 0; ch := name[i];
|
INC(i); j := 0; ch := name[i];
|
||||||
WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END;
|
WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END;
|
||||||
first[j] := 0X
|
first[j] := 0X
|
||||||
|
|
@ -280,25 +281,24 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver
|
||||||
Wln;
|
Wln;
|
||||||
Ws("Usage: showdef module"); Wln;
|
Ws("Usage: showdef module"); Wln;
|
||||||
Wln;
|
Wln;
|
||||||
Ws("Any path and/or filename extension are stripped from the module name,"); Wln;
|
Ws("Where <module> is a symbol file name. The .sym may be omitted."); Wln;
|
||||||
Ws("and the module is found the same way as it is found by the compiler."); Wln;
|
Ws("If no path is provided, and the module does not exist in the current directory,"); Wln;
|
||||||
Wln;
|
Ws("then showdef will also look for the module in the installed libraries."); Wln;
|
||||||
Ws("Thus the module .sym file must be in the current directory, or module"); Wln;
|
|
||||||
Ws("must be the name of one of the library modules installed with the compiler."); Wln;
|
|
||||||
Texts.Append(Oberon.Log, W.buf)
|
Texts.Append(Oberon.Log, W.buf)
|
||||||
END
|
END
|
||||||
END ShowDef;
|
END ShowDef;
|
||||||
|
|
||||||
PROCEDURE SetPath;
|
PROCEDURE SetDefaultPath;
|
||||||
VAR path: ARRAY 256 OF CHAR;
|
VAR path: ARRAY 256 OF CHAR;
|
||||||
BEGIN
|
BEGIN
|
||||||
COPY(Configuration.installdir, path);
|
path := ".;";
|
||||||
|
Strings.Append(Configuration.installdir, path);
|
||||||
Strings.Append("/2/sym", path);
|
Strings.Append("/2/sym", path);
|
||||||
Files.SetSearchPath(path)
|
Files.SetSearchPath(path)
|
||||||
END SetPath;
|
END SetDefaultPath;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
Texts.OpenWriter(W);
|
Texts.OpenWriter(W);
|
||||||
SetPath;
|
SetDefaultPath;
|
||||||
ShowDef
|
ShowDef
|
||||||
END BrowserCmd.
|
END BrowserCmd.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue