Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/Parse/main/parsercontrol.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Parse/main/parsercontrol.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1200, Fri May 17 19:53:41 2002 UTC revision 1201, Fri May 17 20:48:38 2002 UTC
# Line 16  Line 16 
16    
17  structure ParserControl : PARSER_CONTROL = struct  structure ParserControl : PARSER_CONTROL = struct
18    
19      val m = Controls.registry { name = "parser settings",      val priority = [10, 10, 3]
20                                  priority = [10, 10, 3],      val obscurity = 3
21                                  obscurity = 3,      val prefix = "parser"
22                                  prefix = "parser-",  
23                                  default_suffix = SOME "-default",      val registry = ControlRegistry.new { help = "parser settings" }
24                                  mk_ename = NONE }  
25        val _ = BasicControl.nest (prefix, registry)
26      val string_r = Controls.group m Controls.string  
27        val string_cvt = { tyName = "string",
28                           fromString = SOME,
29                           toString = fn x => x }
30    
31        val flag_cvt = { tyName = "bool",
32                         fromString = Bool.fromString,
33                         toString = Bool.toString }
34    
35    
36        fun new (c, n, e, h, d) = let
37            val r = ref d
38            val ctl = Controls.control { name = n,
39                                         pri = priority,
40                                         obscurity = obscurity,
41                                         help = h,
42                                         ctl = r }
43        in
44            ControlRegistry.register
45                registry
46                { ctl = Controls.stringControl c ctl,
47                  envName = SOME ("PARSER_" ^ e) };
48            r
49        end
50    
     val flag_r = Controls.group m Controls.bool  
51    
52      val primaryPrompt =      val primaryPrompt =
53          Controls.new string_r          new (string_cvt, "primary-prompt", "PRIMARY_PROMPT",
54                       { stem = "primary-prompt",               "primary prompt", "- ")
                        descr = "primary prompt",  
                        fallback = "- " }  
55    
56      val secondaryPrompt =      val secondaryPrompt =
57          Controls.new string_r          new (string_cvt, "secondary-prompt", "SECONDARY_PROMPT",
58                       { stem = "secondary-prompt",               "secondary prompt","= ")
                        descr = "secondary prompt",  
                        fallback = "= " }  
59    
60      val lazysml =      val lazysml =
61          Controls.new flag_r          new (flag_cvt, "lazy-keyword", "LAZY_KEYWORD",
62                       { stem = "lazy-keyword",               "whether `lazy' is considered a keyword", false)
                        descr = "whether `lazy' is considered a keyword",  
                        fallback = false }  
63    
64      val overloadKW =      val overloadKW =
65          Controls.new flag_r          new (flag_cvt, "overload", "OVERLOAD",
66                       { stem = "overload",               "whether (_)overload keyword is enabled", false)
                        descr = "whether (_)overload keyword is enabled",  
                        fallback = false }  
67    
68      val quotation =      val quotation =
69          Controls.new flag_r          new (flag_cvt, "quotations", "QUOTATION",
70                       { stem = "quotations",               "whether (anti-)quotations are recognized", false)
                        descr = "whether (anti-)quotations are recognized",  
                        fallback = false }  
71  end  end

Legend:
Removed from v.1200  
changed lines
  Added in v.1201

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0