Properly escape marked up text in dictionary views
[pspp-builds.git] / src / language / expressions / parse.inc.pl
index 47c590fb306f2c06bc7e1abb8ede6fbdf5773967..4e7243c16086b8c8efb0d1e6c6ce2f36c13c4ee2 100644 (file)
@@ -1,4 +1,8 @@
+use strict;
+use warnings 'all';
+
 do 'generate.pl';
+our (@types, @order, %ops);
 
 sub generate_output {
     my (@members) = ("\"\"", "\"\"", 0, 0, 0, "{}", 0, 0);
@@ -7,7 +11,10 @@ sub generate_output {
     for my $type (@types) {
        next if $type->{ROLE} eq 'fixed';
 
-       my (@members) = ("\"$type->{NAME}\"", "\"$type->{HUMAN_NAME}\"",
+       my ($human_name) = $type->{HUMAN_NAME};
+       $human_name = "" if !defined $human_name;
+       
+       my (@members) = ("\"$type->{NAME}\"", "\"\"",
                         0, "OP_$type->{NAME}", 0, "{}", 0, 0);
        print "{", join (', ', @members), "},\n";
     }
@@ -56,6 +63,7 @@ sub generate_output {
        push (@flags, "OPF_EXTENSION") if $op->{EXTENSION};
        push (@flags, "OPF_UNIMPLEMENTED") if $op->{UNIMPLEMENTED};
        push (@flags, "OPF_PERM_ONLY") if $op->{PERM_ONLY};
+       push (@flags, "OPF_NO_ABBREV") if $op->{NO_ABBREV};
        push (@members, @flags ? join (' | ', @flags) : 0);
 
        push (@members, "OP_$op->{RETURNS}{NAME}");