]> git.mdlowis.com Git - proto/sclpl-rb.git/commitdiff
reorged code slightly
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 27 Jan 2020 15:25:23 +0000 (10:25 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 27 Jan 2020 15:25:23 +0000 (10:25 -0500)
Ada Notes.html
compile.rb
example.src

index c209969af5e254f4e6407a05bf2bdd95a788636e..d3001ca0c7c7c92b1be9ecd3a0d935deb3c6047e 100644 (file)
@@ -2,7 +2,7 @@
 <!-- saved from url=(0059)file:///home/mdlowis/Source/proto/sclpl-rb/Ada%20Notes.html -->
 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Ada Notes</title>
-    
+
     <style>
 * { -moz-box-sizing: border-box; box-sizing: border-box; }
 *:focus { outline: none; }
@@ -24,18 +24,10 @@ h6 { font-size: 0.67rem; }
 a { color: deepskyblue; }
 li  { margin-bottom: 1rem; }
 
-table {
-       display: block;
-       width: 100%;
-       overflow: auto;
-       border-spacing: 0;
-       border-collapse: collapse;
-}
-
 code {
        display: block;
        padding: 1rem 1.5rem;
-       white-space: pre;
+       white-space: pre-wrap;
        margin: 0.2rem;
        background: #F1F1F1;
        border: 1px solid #E1E1E1;
@@ -52,24 +44,6 @@ blockquote {
        padding-left: 15px;
        margin-right: 0px;
 }
-
-table {
-       width: 100%;
-       display: table;
-       border-collapse: separate;
-       border-color: grey;
-       text-align: left;
-       vertical-align: middle;
-}
-
-th, td {
-       padding: 0.80rem 0.80rem;
-       border-bottom: 1px solid #E1E1E1;
-}
-
-th:first-child, td:first-child {
-       padding-left: 0;
-}
     </style>
 </head>
 <body>
@@ -84,21 +58,21 @@ int_def := range_spec
 
 real_def := 'digits' static_simple_expr { range_spec }
 
-array_def := 
+array_def :=
 
-record_def := 
+record_def :=
 
-access_def := 
+access_def :=
 
-derived_def := 
+derived_def :=
 
-interface_def := 
+interface_def :=
 
 # Miscellaneous
 symbol := &lt;ident&gt; | &lt;char-lit&gt;
 range_spec := 'range' static_simple_expr '..' static_simple_expr
 static_expr :=
-static_simple_expr := 
+static_simple_expr :=
 
 </code></div><p></p></div></article>
     </section>
index 29715199b3d1696bc105dde1ffa448816856e7d1..f128cd0e76d3ce85c3854c12eafe0593aa394a3a 100755 (executable)
@@ -226,15 +226,10 @@ class Parser
     sym[:kind] = :var
     sym[:type] = type_specifier()
     if accept("=")
-      sym[:value] = const_expr()
+      sym[:value] = expression()
     end
   end
 
-  def const_expr()
-    expect("{")
-    expect("}")
-  end
-
   #######################################
   # Function Definitions
   #######################################
@@ -264,6 +259,17 @@ class Parser
     expect("}")
   end
 
+  #######################################
+  # Expression Parsing
+  #######################################
+  def expression()
+    expect("{")
+    expect("}")
+  end
+
+  #######################################
+  # Parsing Primitives
+  #######################################
   def error(str)
     puts str
     exit 1
index de48bf891a5a5d6ffaf62cf08f5467f7697cba9a..ec09af4933a925f5dccd48f31fe5bb943e7e7b30 100644 (file)
@@ -1,20 +1,8 @@
 module Main
 imports (X11, XSel, Posix)
 
-Command is [ 1 String ]
-Command2 is [10 [5 String]]
-PointRef is **Point
-MyStruct is {
-  foo : Int
-  bar : [10 Int]
-}
+cmd : [String] = [ "fetch", nil, nil ]
 
-##Command is {
-##    name : String
-##}
-#
-#cmd : Command #= [ "fetch", nil, nil ]
-#
 #fetchsel(sel : String)
 #{
 ##    cmd[1] = sel;
@@ -23,7 +11,7 @@ MyStruct is {
 #
 #$main(args : array of String) : Int
 #{
-##    x : X11.Config = {0}
+##    x : X11.Config = {}
 ##    X11.init(&x)
 ##    X11.mkwin(&x, 1, 1, X11.PropertyChangeMask)
 ##    XSel.init(&x)