Class: ChangeColumnDefaultFuncFilter
Instance Attribute Summary
#column_option_str, #fclass, #func_option_str, #func_str
Instance Method Summary
collapse
#on_comma
#add_tok, #on_default, #on_do_block, #on_lbrase, #on_nl, #on_rbrase, #on_tstring_beg, #on_tstring_end
Constructor Details
Returns a new instance of ChangeColumnDefaultFuncFilter.
336
337
338
339
340
|
# File 'lib/func_filter.rb', line 336
def initialize(src, fclass)
super src, fclass
@is_default = false
end
|
Instance Method Details
#on_float(tok, f) ⇒ Object
390
391
392
393
394
395
396
397
|
# File 'lib/func_filter.rb', line 390
def on_float(tok, f)
if @is_default && @is_comma
@fclass.set_column_default tok
@is_comma = false
@is_default = false;
end
add_tok tok
end
|
#on_ident(tok, f) ⇒ Object
357
358
359
360
361
362
363
364
365
366
367
368
369
|
# File 'lib/func_filter.rb', line 357
def on_ident(tok, f)
if @is_func_option && @is_comma
@fclass.add_column_name tok
@is_func_option = false
@is_comma = false
@is_default = true;
elsif @is_default && @is_comma
@fclass.set_column_default tok
@is_comma = false
@is_default = false;
end
add_tok tok
end
|
#on_int(tok, f) ⇒ Object
381
382
383
384
385
386
387
388
|
# File 'lib/func_filter.rb', line 381
def on_int(tok, f)
if @is_default && @is_comma
@fclass.set_column_default tok
@is_comma = false
@is_default = false;
end
add_tok tok
end
|
#on_kw(tok, f) ⇒ Object
342
343
344
345
346
347
348
349
350
351
352
353
354
355
|
# File 'lib/func_filter.rb', line 342
def on_kw(tok, f)
if tok == 'end'
if @is_do
@is_do = false
end
elsif tok == 'true' || tok == 'false'
if @is_default && @is_comma
@fclass.set_column_default tok
@is_comma = false
@is_default = false;
end
end
add_tok tok
end
|
#on_tstring_content(tok, f) ⇒ Object
371
372
373
374
375
376
377
378
379
|
# File 'lib/func_filter.rb', line 371
def on_tstring_content(tok, f)
if @is_default && @is_comma
@fclass.set_column_default "'#{tok}'"
@is_comma = false
@is_default = false;
end
@is_tstring_content = true
add_tok tok
end
|