potrubi 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/lib/potrubi.rb +1 -1
  2. data/lib/potrubi/bootstrap.rb +1 -1
  3. data/lib/potrubi/core.rb +3 -3
  4. data/lib/potrubi/dsl.rb +86 -0
  5. data/lib/potrubi/dsl/accessor.rb +76 -0
  6. data/lib/potrubi/dsl/cache_2d.rb +811 -0
  7. data/lib/potrubi/dsl/contract.rb +731 -0
  8. data/lib/potrubi/dsl/super.rb +517 -0
  9. data/lib/potrubi/klass/syntax/alias.rb +150 -0
  10. data/lib/potrubi/klass/syntax/braket.rb +115 -25
  11. data/lib/potrubi/klass/syntax/builder.rb +45 -0
  12. data/lib/potrubi/klass/syntax/method.rb +436 -0
  13. data/lib/potrubi/klass/syntax/mixin/name_generation.rb +85 -0
  14. data/lib/potrubi/klass/syntax/mixin/new_aliases.rb +76 -0
  15. data/lib/potrubi/klass/syntax/mixin/new_brakets.rb +89 -0
  16. data/lib/potrubi/klass/syntax/mixin/new_methods.rb +158 -0
  17. data/lib/potrubi/klass/syntax/mixin/new_snippets.rb +74 -0
  18. data/lib/potrubi/klass/syntax/mixin/new_statements.rb +0 -0
  19. data/lib/potrubi/klass/syntax/mixin/statement_management.rb +69 -0
  20. data/lib/potrubi/klass/syntax/mixin/synel_management.rb +168 -0
  21. data/lib/potrubi/klass/syntax/snippet.rb +386 -0
  22. data/lib/potrubi/klass/syntax/statement.rb +91 -0
  23. data/lib/potrubi/klass/syntax/super.rb +88 -0
  24. data/lib/potrubi/mixin/bootstrap_common.rb +38 -12
  25. data/lib/potrubi/mixin/configuration.rb +31 -3
  26. data/lib/potrubi/mixin/contract.rb +5 -14
  27. data/lib/potrubi/mixin/contract/recipes.rb +307 -0
  28. data/lib/potrubi/mixin/dynamic-recipes.rb +1 -11
  29. data/lib/potrubi/mixin/dynamic.rb +223 -115
  30. data/lib/potrubi/mixin/exception.rb +3 -22
  31. data/lib/potrubi/mixin/filesys.rb +5 -21
  32. data/lib/potrubi/mixin/initialize.rb +11 -6
  33. data/lib/potrubi/mixin/konstant.rb +14 -118
  34. data/lib/potrubi/mixin/logger.rb +28 -41
  35. data/lib/potrubi/mixin/pathandnames.rb +4 -34
  36. data/lib/potrubi/mixin/persistence.rb +115 -10
  37. data/lib/potrubi/mixin/script.rb +0 -5
  38. data/lib/potrubi/mixin/{text-snippets → snippet-dictionaries}/methods-text-snippets.rb +138 -49
  39. data/lib/potrubi/mixin/{text-snippets.rb → snippet-manager.rb} +51 -39
  40. data/lib/potrubi/mixin/util.rb +66 -20
  41. data/lib/potrubi/version.rb +1 -1
  42. data/test/potrubi/mixin/bootstrap_common.rb +205 -0
  43. data/test/potrubi/mixin/konstant.rb +216 -0
  44. data/test/potrubi/mixin/logger.rb +124 -0
  45. data/test/ts_bootstrap_mixins.rb +16 -0
  46. data/test/ts_core_mixins.rb +7 -0
  47. metadata +31 -6
  48. data/lib/potrubi/mixin/contract-recipes.rb +0 -226
@@ -0,0 +1,69 @@
1
+
2
+ # potrubi contract dsl
3
+
4
+ # syntax methods: method
5
+
6
+ # to ease the creation of new methods using text manipulation
7
+
8
+ #require_relative '../../bootstrap'
9
+
10
+ #requireList = %w(base )
11
+ #requireList.each {|r| require_relative "#{r}"}
12
+ ###require "potrubi/klass/syntax/braket"
13
+
14
+
15
+ instanceMethods = Module.new do
16
+
17
+ # Statement Management
18
+ # ####################
19
+
20
+ def statements
21
+ @statements ||= []
22
+ end
23
+
24
+ def statements=(*newStms)
25
+ newStmsNrm = newStms.flatten.compact.map {|s| mustbe_statement_or_croak(s) }
26
+ @statements = newStmsNrm
27
+ end
28
+
29
+ def add_statements_or_croak(*newStatements)
30
+ eye = :'PotKlsSynMth::a_stms'
31
+ eyeTale = 'ADD STMS'
32
+
33
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTale, potrubi_bootstrap_logger_fmt_who_only(newStatements: newStatements))
34
+
35
+ newStms = newStatements.flatten.compact
36
+ sizStm = newStms.size
37
+ newStms.each_with_index do | newStm, ndxStm|
38
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ms(eye, eyeTale, ">#{ndxStm}< of >#{sizStm}<", potrubi_bootstrap_logger_fmt_who(newStm: newStm), "SYN >#{newStm.inspect}<")
39
+ mustbe_statement_or_croak(newStm)
40
+ end
41
+
42
+ newStatementsNrm = newStms.map {|s| mustbe_statement_or_croak(s) }
43
+ statements.concat(newStatementsNrm)
44
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, eyeTale, potrubi_bootstrap_logger_fmt_who_only(newStms: newStatementsNrm))
45
+ self
46
+ #SYOPHEREADDSTMSEXIT
47
+ end
48
+ ###alias_method :add_statement, :add_statements
49
+
50
+ end
51
+
52
+
53
+
54
+ module Potrubi
55
+ class Klass
56
+ module Syntax
57
+ module Mixin
58
+ module StatementManagement
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ Potrubi::Klass::Syntax::Mixin::StatementManagement.__send__(:include, instanceMethods) # Instance Methods
66
+
67
+
68
+ __END__
69
+
@@ -0,0 +1,168 @@
1
+
2
+ # potrubi contract dsl
3
+
4
+ # syntax methods: method
5
+
6
+ # to ease the creation of new methods using text manipulation
7
+
8
+ #require_relative '../../bootstrap'
9
+
10
+ #requireList = %w(base )
11
+ #requireList.each {|r| require_relative "#{r}"}
12
+ ###require "potrubi/klass/syntax/braket"
13
+
14
+
15
+ instanceMethods = Module.new do
16
+
17
+ # Synel Management
18
+ # ################
19
+
20
+ # Synels are any onject that inherits Syntax:Super
21
+
22
+ def synel_klass
23
+ @synel_klass ||= Potrubi::Klass::Syntax::Super
24
+ end
25
+
26
+ # the container is a braket because of the six edges
27
+ def synel_container_klass
28
+ @synel_container_klass ||= Potrubi::Klass::Syntax::Braket
29
+ end
30
+
31
+ def new_synel_container
32
+ synel_container_klass.new_snippet
33
+ end
34
+
35
+ def synels
36
+ @synels ||= new_synel_container
37
+ end
38
+
39
+ def mustbe_synel_or_croak(synelValue)
40
+ synelValue.is_a?(synel_klass) ? synelValue : potrubi_bootstrap_surprise_exception(synelValue, :mustbe_syn, "synelValue not a synel")
41
+ end
42
+
43
+ def mustbe_synel_container_or_croak(synelContainer)
44
+ synelContainer.is_a?(synel_container_klass) ? synelContainer : potrubi_bootstrap_surprise_exception(synelContainer, :mustbe_syn, "synelContainer not a synel_container")
45
+ end
46
+
47
+ def synels=(newSynContainer)
48
+ @synels = mustbe_synel_container_or_croak(newSynContainer)
49
+ end
50
+
51
+ def xxxxsynels=(*newSyns)
52
+ synels.clear
53
+ add_synels_or_croak(*newSyns)
54
+ end
55
+
56
+ def zzzsynels=(*newSyns)
57
+ newSynsNrm = newSyns.flatten.compact.map {|s| mustbe_synel_or_croak(s) }
58
+ @synels = newSynsNrm
59
+ end
60
+
61
+ def add_synels_or_croak(*newSynels)
62
+ eye = :'PotKlsSynMixSnlMan::a_synels'
63
+ eyeTale = 'ADD SYNELS'
64
+
65
+ puts("#{eye} X0")
66
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTale, potrubi_bootstrap_logger_fmt_who_only(newSynels: newSynels))
67
+
68
+ newSyns = newSynels.flatten.compact
69
+ #STOPHEREADDSYNELSPOSTFLATTEN
70
+ puts("#{eye} X1")
71
+ #newSyns = newSynels
72
+
73
+ sizSyn = newSyns.size
74
+ newSyns.each_with_index do | newSyn, ndxSyn|
75
+ newSyn.is_a?(Potrubi::Klass::Syntax::Method) && potrubi_bootstrap_surprise_exception(ndxSyn, eye, "SYNEL IS A METHOD")
76
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ms(eye, eyeTale, 'TEST', ">#{ndxSyn}< of >#{sizSyn}<", potrubi_bootstrap_logger_fmt_who(newSyn: newSyn), "SYN >#{newSyn.syntax}<")
77
+ #$DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ms(eye, eyeTale, ">#{ndxSyn}< of >#{sizSyn}<", potrubi_bootstrap_logger_fmt_who(newSyn: newSyn), "SYN >#{newSyn.inspect}<")
78
+ mustbe_synel_or_croak(newSyn)
79
+ end
80
+
81
+ #STOPHEREADDSYNELSX1
82
+ puts("#{eye} X2")
83
+
84
+ newSynelsNrm = newSyns.map {|s| mustbe_synel_or_croak(s) }
85
+
86
+ #STOPHEREADDSYNELSX2
87
+
88
+ puts("#{eye} X3")
89
+ synels.push_midl(newSynelsNrm)
90
+
91
+
92
+ #STOPHEREADDSYNELSX3
93
+ puts("#{eye} X4")
94
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, eyeTale, potrubi_bootstrap_logger_fmt_who_only(newSyns: newSynelsNrm))
95
+
96
+ puts("#{eye} #{eyeTale} EXITSING CHECK ANY TO_Ses")
97
+
98
+ self
99
+ #SYOPHEREADDSTMSEXIT
100
+ end
101
+
102
+ # Passthru to Delegate
103
+ # ####################
104
+
105
+ # Delegate must handle
106
+
107
+ callPassthruMap = {
108
+
109
+ push: nil,
110
+ pop: nil,
111
+ shift: nil,
112
+ unshift: nil,
113
+ cons: nil,
114
+ tail: nil,
115
+
116
+ push_west: nil,
117
+ pop_west: nil,
118
+ shift_west: nil,
119
+ unshift_west: nil,
120
+ cons_west: nil,
121
+ tail_west: nil,
122
+
123
+ push_midl: nil,
124
+ pop_midl: nil,
125
+ shift_midl: nil,
126
+ unshift_midl: nil,
127
+ cons_midl: nil,
128
+ tail_midl: nil,
129
+
130
+ push_east: nil,
131
+ pop_east: nil,
132
+ shift_east: nil,
133
+ unshift_east: nil,
134
+ cons_east: nil,
135
+ tail_east: nil,
136
+
137
+ }
138
+
139
+ callPassthruTexts = callPassthruMap.map do |srcMth, tgtMth|
140
+ tgtMthNrm = tgtMth || srcMth
141
+ "def #{srcMth}_synels(*a, &b); synels.#{tgtMthNrm}(*a, &b); end;"
142
+ end
143
+
144
+ callPassthruText = callPassthruTexts.flatten.compact.join("\n")
145
+ puts("SYNELS PASSTHRU MAP >\n#{callPassthruText}")
146
+ module_eval(callPassthruText)
147
+
148
+
149
+ end
150
+
151
+
152
+
153
+ module Potrubi
154
+ class Klass
155
+ module Syntax
156
+ module Mixin
157
+ module SynelManagement
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end
163
+
164
+ Potrubi::Klass::Syntax::Mixin::SynelManagement.__send__(:include, instanceMethods) # Instance Methods
165
+
166
+
167
+ __END__
168
+
@@ -0,0 +1,386 @@
1
+
2
+ # potrubi contract dsl
3
+
4
+ # syntax methods: snippets
5
+
6
+ # to ease the creation of new methods using text snippets
7
+
8
+ #require_relative '../../bootstrap'
9
+
10
+ requireList = %w(super ./mixin/new_aliases ./mixin/new_methods ./mixin/new_statements ./mixin/name_generation ./mixin/synel_management)
11
+ #requireList = %w(super ./mixin/new_methods)
12
+ defined?(requireList) && requireList.each {|r| require_relative "#{r}"}
13
+
14
+ #__END__
15
+
16
+ instanceMethods = Module.new do
17
+
18
+ include Potrubi::Bootstrap
19
+ ##include Potrubi::Mixin::Util
20
+ include Potrubi::Klass::Syntax::Mixin::NewStatements
21
+ include Potrubi::Klass::Syntax::Mixin::NameGeneration
22
+ include Potrubi::Klass::Syntax::Mixin::SynelManagement
23
+
24
+ ###attr_accessor :name, :type, :key, :value, :variant, :spec, :edit,
25
+ ###:blok, :key_names, :default
26
+
27
+ # Note the parent is the *delegate's* parent
28
+ attr_accessor :parent, :delegate
29
+
30
+ def to_s
31
+ syntax
32
+ end
33
+
34
+ def inspect
35
+ ###potrubi_bootstrap_logger_fmt(potrubi_bootstrap_logger_instance_telltale('DSLSynMth'), potrubi_bootstrap_logger_fmt(n: name))
36
+ @to_inspect ||= potrubi_bootstrap_logger_fmt(potrubi_bootstrap_logger_instance_telltale('DSLSynSnp'))
37
+ end
38
+
39
+ def find_parent_or_croak
40
+ potrubi_bootstrap_mustbe_not_nil_or_croak(parent)
41
+ end
42
+
43
+ def call_parent_or_croak(mthName, *mthArgs, &mthBlok)
44
+ find_parent_or_croak.__send__(mthName, *mthArgs, &mthBlok)
45
+ end
46
+
47
+ def find_delegate_or_croak
48
+ potrubi_bootstrap_mustbe_not_nil_or_croak(delegate)
49
+ end
50
+
51
+ def call_delegate_or_croak(mthName, *mthArgs, &mthBlok)
52
+ find_delegate_or_croak.__send__(mthName, *mthArgs, &mthBlok)
53
+ end
54
+
55
+ def method_missing(mthName, *mthArgs, &mthBlok)
56
+ #(mthName == :to_ary) && (return super)
57
+ (mthName == :to_ary) && super
58
+ eye = :'PotKlsSynSnp::mth_mis'
59
+ eyeTaleME = '>>>>>>>>>>>>>>>>>>> SNIPPET MM'
60
+ eyeTaleMX = '<<<<<<<<<<<<<<<<<<< SNIPPET MM'
61
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTaleME, potrubi_bootstrap_logger_fmt_who_only(mthName: mthName, mthArgs: mthArgs, mthBlok: mthBlok))
62
+
63
+
64
+ mthResult = nil
65
+ #STOPHERESNIPPETMETHODMISSINGENTR
66
+
67
+ mthResult = case
68
+ when mthName == :to_ary then super
69
+ when (r = delegate) && r.respond_to?(mthName) then r.__send__(mthName, *mthArgs, &mthBlok)
70
+ else
71
+ potrubi_bootstrap_missing_exception(mthName, eye, "METHOD MISSING mthName >#{mthName}< mthArgs >#{mthArgs}< not found")
72
+ end
73
+
74
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, eyeTaleMX, potrubi_bootstrap_logger_fmt_who_only(mthName: mthName, mthArgs: mthArgs, mthBlok: mthBlok, mthResult: mthResult))
75
+
76
+ mthResult
77
+ end
78
+
79
+ # Snippet Methods
80
+ # ###############
81
+
82
+ # def new_snippets(*snippets, &snipBlok)
83
+ # snippets.map {|s| new_statement(s) }
84
+ # end
85
+
86
+ # Call Direct Mapping
87
+ # #####################
88
+
89
+ # These are verbs that map directly to the direct
90
+
91
+ callDirectMap = {
92
+ contracts: nil,
93
+ assign_expression: :new_statement_assign,
94
+ ####assign: nil,
95
+ assign_instance_variable: nil,
96
+ assign_local_variable: nil,
97
+ ###assign_if_not_set: nil,
98
+ name: :set_name,
99
+ eye: :set_eye,
100
+ ################################result: :set_result,
101
+ logger_call: :new_statement_logger_method_call,
102
+ logger_entry: :new_statement_logger_method_entry,
103
+ logger_exit: :new_statement_logger_method_exit,
104
+
105
+ #####if_ternary: :new_statement_if_ternary,
106
+
107
+ snippet: :new_statements,
108
+ snippets: :new_statements,
109
+
110
+
111
+ }
112
+
113
+
114
+ callDirectTexts = callDirectMap.map do |srcMth, tgtMth|
115
+ tgtMthNrm = tgtMth || "new_statement_#{srcMth}"
116
+
117
+ #"def #{srcMth}(*a, &b); add_statements_or_croak(find_direct_or_croak.#{tgtMthNrm}(*a, &b)); end;"
118
+ #"def #{srcMth}(*a, &b); add_synels_or_croak(direct.#{tgtMthNrm}(*a, &b)); end;"
119
+ "def #{srcMth}(*a, &b); add_synels_or_croak(#{tgtMthNrm}(*a, &b)); end;"
120
+
121
+ end
122
+
123
+ ###callDirectTexts << "def add_statement(*a, &b); add_statements_or_croak(new_statement(*a, &b)); end;"
124
+ callDirectText = callDirectTexts.flatten.compact.join("\n")
125
+ puts("SNIPPET CALL DIRECT MAP >\n#{callDirectText}")
126
+ module_eval(callDirectText)
127
+
128
+ #SUPHEREDELEGATEMAP
129
+
130
+ # Passthru to Delegate
131
+ # #####################
132
+
133
+ # Delegate must handle
134
+
135
+ callPassthruMap = {
136
+ set_name: nil,
137
+ set_eye: nil,
138
+ set_result: nil,
139
+ name: :set_name,
140
+ eye: :set_eye,
141
+ result: :set_result,
142
+ set_signature: nil,
143
+ get_signature: nil,
144
+ ###signature: :set_signature,
145
+ generic_signature: :set_signature_generic,
146
+ iterator: :iterator_block,
147
+ ####assign_expression: :assign,
148
+
149
+ ###snippet: :add_statements,
150
+ ###snippets: :add_statements,
151
+ }
152
+
153
+ callPassthruTexts = callPassthruMap.map do |srcMth, tgtMth|
154
+ tgtMthNrm = case tgtMth
155
+ when NilClass then srcMth
156
+ else
157
+ tgtMth
158
+ end
159
+ "def #{srcMth}(*a, &b); delegate.#{tgtMthNrm}(*a, &b); end;"
160
+ end
161
+
162
+ callPassthruText = callPassthruTexts.flatten.compact.join("\n")
163
+ puts("CALL PASSTHRU MAP >\n#{callPassthruText}")
164
+ module_eval(callPassthruText)
165
+
166
+ #STOPHEREPOSTNEWTOADDMAP
167
+
168
+ # Assign Verbs
169
+ # ############
170
+
171
+ def assign(assignTarget, assignExpression, *assignArgs, &assignBlok)
172
+ #STOPHERESNIPASSIGNENTR
173
+ # case assignExpression
174
+ # when Symbol then
175
+ assign_expression(assignTarget, expression(assignExpression, *assignArgs, &assignBlok))
176
+ # else
177
+ # assign_expression(assignTarget, assignExpression, *assignArgs, &assignBlok)
178
+ # end
179
+ self # fluent
180
+ end
181
+
182
+ def zzzassign_expression(*a, &b)
183
+ puts("AGN EXPRE a >#{a}<")
184
+ #add_statement_asign(*a)
185
+ add_synels_or_croak(new_staement_assign(*a))
186
+ STOPHEREASSIGNEXPREENTR
187
+ end
188
+
189
+ # Other Verbs
190
+ # ###########
191
+
192
+ def croak_name(*a, &b)
193
+ set_name(name_builder_method_or_croak(*a, &b))
194
+ end
195
+
196
+ def getter_name(*a, &b)
197
+ set_name(name_builder_method_getter(*a, &b))
198
+ end
199
+
200
+ def setter_name(*a, &b)
201
+ set_name(name_builder_method_setter(*a, &b))
202
+ end
203
+
204
+ def getter_eye(*a, &b)
205
+ set_eye(name_builder_eye_getter(*a, &b))
206
+ end
207
+
208
+ def setter_eye(*a, &b)
209
+ set_eye(name_builder_eye_setter(*a, &b))
210
+ end
211
+
212
+ def named_expression(exprName, *a, &b)
213
+ exprMth = "new_statement_#{exprName}"
214
+ expression(__send__(exprMth, *a, &b))
215
+ end
216
+
217
+ def zzzzzzexpression(*a, &b)
218
+ #new_statement_in_parentheses(*a)
219
+ new_statement(*a)
220
+ end
221
+
222
+ def expression(exprName, *a, &b)
223
+ new_statement(maybe_call_specific(self, :new_statement, exprName, *a))
224
+ end
225
+
226
+ def instance_variable(*a)
227
+ name_builder_instance_variable(*a)
228
+ end
229
+
230
+ def method_name(*a, &b)
231
+ name_builder_method(*a)
232
+ end
233
+
234
+ def signature(sigName, *sigArgs)
235
+ maybe_call_specific(delegate, :set_signature, sigName, *sigArgs)
236
+ end
237
+
238
+ def maybe_call_specific(mthTarget, mthPrefix, mthName, *mthArgs)
239
+ mthMethod = case mthName
240
+ when Symbol then "#{mthPrefix}_#{mthName}"
241
+ else
242
+ nil
243
+ end
244
+ (mthMethod && mthTarget.respond_to?(mthMethod)) ? mthTarget.__send__(mthMethod, *mthArgs) : __send__(mthPrefix, mthName, *mthArgs)
245
+ end
246
+
247
+ # Syntax Methods
248
+ # ##############
249
+
250
+
251
+ def syntax
252
+ eye = :'PotKlsSynSnp::syn'
253
+ eyeTaleME = '>>>>>>>>>>>>>>>>>> SYN SNIP'
254
+ eyeTaleMX = '<<<<<<<<<<<<<<<<<< SYN SNIP'
255
+ ###nameMethod = name
256
+
257
+ snippetSyns = synels
258
+
259
+ ###puts("#{eye} SNIPPETR SYNELS >#{snippetSyns.class}<")
260
+
261
+ snippetSyns.raw_debug("#{eye} SNIPPET SYNTAX")
262
+
263
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTaleME, potrubi_bootstrap_logger_fmt_who_only(snippetSyns: snippetSyns))
264
+
265
+ syntaxSnippets = case
266
+ when snippetSyns.empty? then nil
267
+ else
268
+
269
+ braketSnippets = new_braket_snippet
270
+
271
+ braketSnippets.push(###make_syntax_def,
272
+ ###make_syntax_eye,
273
+ ###statements.map {|s| s.syntax },
274
+ snippetSyns,
275
+ ###make_syntax_result,
276
+ ###make_syntax_end
277
+
278
+ )
279
+
280
+ braketSnippets.to_s
281
+
282
+ end
283
+
284
+ puts("#{eye} SYNTAX SNIPPET syntax \n#{syntaxSnippets}")
285
+
286
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, eyeTaleMX, potrubi_bootstrap_logger_fmt_who_only(synAli: syntaxSnippets))
287
+
288
+ syntaxSnippets
289
+ end
290
+
291
+
292
+
293
+
294
+ end
295
+
296
+ module Potrubi
297
+ class Klass
298
+ module Syntax
299
+ class Snippet < Super
300
+ end
301
+ end
302
+ end
303
+ end
304
+
305
+ Potrubi::Klass::Syntax::Snippet.__send__(:include, instanceMethods) # Instance Methods
306
+
307
+ __END__
308
+ Potrubi::Klass::Syntax::Snippet.extend(classMethods) # Class Methods
309
+
310
+ __END__
311
+
312
+ m = Potrubi::DSL::Syntax::Method.new_method
313
+
314
+ __END__
315
+
316
+ classMethods = Module.new do
317
+
318
+ def new_contract(dslArgs=nil, &dslBlok) # class method
319
+ eye = :'DSLAcc::KLS new_cxt'
320
+ #potrubi_bootstrap_mustbe_symbol_or_croak(dslAttr, eye, "dslAttr is what?")
321
+ newContract = self.new(dslArgs, &dslBlok)
322
+ #$DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ca(eye, potrubi_bootstrap_logger_fmt_who(newContract: newContract), potrubi_bootstrap_logger_fmt_who(dslAttr: dslAttr, dslArgs: dslArgsNrm, dslBlok: dslBlok))
323
+ newContract
324
+ ###STOPHERENEWCONTRACTEXIT
325
+ end
326
+ end
327
+
328
+ Potrubi::Mixin::Contract::DSL.extend(classMethods) # CLass Methods
329
+
330
+ __END__
331
+
332
+ def new_method(*a, &b)
333
+ self.class.new_method(*a, &b)
334
+ end
335
+
336
+ def new_statement(*a)
337
+ puts("METHOD NEW STATEMNET")
338
+ bktStm = new_braket_statement
339
+ a.empty? || bktStm.push(*a)
340
+ ##:wouldbeanewstat
341
+ bktStm
342
+ end
343
+
344
+
345
+ def new_method(dslArgs=nil, &dslBlok) # class method
346
+ eye = :'PotKlsSynMth::n'
347
+ puts("NEW METHOD")
348
+ #potrubi_bootstrap_mustbe_symbol_or_croak(dslAttr, eye, "dslAttr is what?")
349
+ newMethod = new(dslArgs, &dslBlok)
350
+ #$DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ca(eye, potrubi_bootstrap_logger_fmt_who(newMethod: newMethod), potrubi_bootstrap_logger_fmt_who(dslAttr: dslAttr, dslArgs: dslArgsNrm, dslBlok: dslBlok))
351
+ newMethod
352
+ ###STOPHERENEWMETHODEXIT
353
+ end
354
+
355
+ def zzzadd_statement(*statementElements)
356
+ eye = :'PotKlsSynMth::a_stm'
357
+
358
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, potrubi_bootstrap_logger_fmt_who(statementElements: statementElements))
359
+
360
+ newStatement = new_statement(statementElements)
361
+
362
+ add_statements_or_croak(newStatement)
363
+
364
+ $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, potrubi_bootstrap_logger_fmt_who_only(newStatement: newStatement, statementElements: statementElements))
365
+
366
+ self # allows for "fluent interface"
367
+
368
+ end
369
+
370
+ classMethods = Module.new do
371
+
372
+ include Potrubi::Bootstrap
373
+
374
+ # let the class be able to call new_methiod
375
+ include Potrubi::Klass::Syntax::Mixin::NewMethods
376
+
377
+ end
378
+ def zzzsignature(sigName, *sigArgs)
379
+ case sigName
380
+ when Symbol
381
+ sigMethod = "set_signature_#{sigName}"
382
+ delegate.respond_to?(sigMethod) ? delegate.__send__(sigMethod, *sigArgs) : set_signature(sigName, *sigArgs)
383
+ else
384
+ set_signature(sigName, *sigArgs)
385
+ end
386
+ end