summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Command/Commands.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-18 07:22:30 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-18 07:22:30 +0000
commit0f21f8f3436d732838dc76da0c1005eb332961ff (patch)
treeacf77a40a85c6522bdc4fbe763a25184ee9d62b8 /src-3.0/GF/Command/Commands.hs
parent23b8136af27b0baaa8fcb5272a613d5f2ee447fa (diff)
macros for commands (dc) and terms (dt)
Diffstat (limited to 'src-3.0/GF/Command/Commands.hs')
-rw-r--r--src-3.0/GF/Command/Commands.hs29
1 files changed, 28 insertions, 1 deletions
diff --git a/src-3.0/GF/Command/Commands.hs b/src-3.0/GF/Command/Commands.hs
index f442cfa22..6fd4a1fb2 100644
--- a/src-3.0/GF/Command/Commands.hs
+++ b/src-3.0/GF/Command/Commands.hs
@@ -89,7 +89,9 @@ allCommands pgf = Map.fromList [
"N.B.1 You need the flag -retain when importing the grammar, if you want",
"the definitions to be retained after compilation.",
"N.B.2 The resulting term is not a tree in the sense of abstract syntax",
- "and hence not a valid input to a Tree-expecting command."
+ "and hence not a valid input to a Tree-expecting command.",
+ "This command must be a line of its own, and thus cannot be a part",
+ "of a pipe."
],
options = [
("all","pick all strings (forms and variants) from records and tables"),
@@ -97,6 +99,31 @@ allCommands pgf = Map.fromList [
("unqual","hide qualifying module names")
]
}),
+ ("dc", emptyCommandInfo {
+ longname = "define_command",
+ syntax = "dc IDENT COMMANDLINE",
+ synopsis = "define a command macro",
+ explanation = unlines [
+ "Defines IDENT as macro for COMMANDLINE, until IDENT gets redefined.",
+ "A call of the command has the form %IDENT. The command may take an",
+ "argument, which in COMMANDLINE is marked as ?0. Both strings and",
+ "trees can be arguments. Currently at most one argument is possible.",
+ "This command must be a line of its own, and thus cannot be a part",
+ "of a pipe."
+ ]
+ }),
+ ("dt", emptyCommandInfo {
+ longname = "define_tree",
+ syntax = "dt IDENT (TREE | STRING)", -- | '<' COMMANDLINE)",
+ synopsis = "define a tree or string macro",
+ explanation = unlines [
+ "Defines IDENT as macro for TREE or STRING, until IDENT gets redefined.",
+ -- "The defining value can also come from a command, preceded by '<'.",
+ "A use of the macro has the form %IDENT. Currently this use cannot be",
+ "a subtree of another tree. This command must be a line of its own",
+ "and thus cannot be a part of a pipe."
+ ]
+ }),
("e", emptyCommandInfo {
longname = "empty",
synopsis = "empty the environment"