diff options
| author | aarne <aarne@chalmers.se> | 2011-09-21 08:12:14 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2011-09-21 08:12:14 +0000 |
| commit | 958e81126d9bee7d190e738102836918f37b756b (patch) | |
| tree | f3f6dd26e28b2738741f85befe2f268d6a59c729 /src/compiler/GF/Command | |
| parent | 33a42b1c7ca74fd4484fd143b5396d61fa924eb7 (diff) | |
commands ss to show source, and sd to show the dependencies of a constant
Diffstat (limited to 'src/compiler/GF/Command')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index 8d7297f1e..a743ee1f0 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -778,6 +778,26 @@ allCommands env@(pgf, mos) = Map.fromList [ ("tq -from=Eng -to=Swe (AdjCN (PositA ?2) (UseN ?)) -- only trees of this form") ] }), + + ("sd", emptyCommandInfo { + longname = "show_dependencies", + syntax = "sd QUALIFIED_CONSTANT", + synopsis = "show all constants that the given constant depends on", + explanation = unlines [ + "Show recursively all qualified constant names, by tracing back the types and definitions", + "of each constant encountered, but just listing every name once.", + "This command requires a source grammar to be in scope, imported with 'import -retain'.", + "Notice that the accuracy is better if the modules are compiled with the flag -optimize=noexpand.", + "This command must be a line of its own, and thus cannot be a part of a pipe." + ], + options = [ + ], + examples = [ + "sd ParadigmsEng.mkV -- show all constants on which this one depends" + ], + needsTypeCheck = False + }), + ("se", emptyCommandInfo { longname = "set_encoding", synopsis = "set the encoding used in current terminal", @@ -831,6 +851,27 @@ allCommands env@(pgf, mos) = Map.fromList [ needsTypeCheck = False }), + ("ss", emptyCommandInfo { + longname = "show_source", + syntax = "ss (-strip)? (-save)? MODULE*", + synopsis = "show the source code of modules in scope, possibly just headers", + explanation = unlines [ + "Show compiled source code, i.e. as it is included in GF object files.", + "This command requires a source grammar to be in scope, imported with 'import -retain'.", + "The optional MODULE arguments cause just these modules to be shown.", + "This command must be a line of its own, and thus cannot be a part of a pipe." + ], + options = [ + ("save", "save each MODULE in file MODULE.gfh instead of printing it on terminal"), + ("strip","show only type signatures of oper's and lin's, not their definitions") + ], + examples = [ + "ss -- print complete current source grammar on terminal", + "ss -strip -save MorphoFin -- print the headers in file MorphoFin.gfh" + ], + needsTypeCheck = False + }), + ("ut", emptyCommandInfo { longname = "unicode_table", synopsis = "show a transliteration table for a unicode character set", |
