regex problem for comments line



str = " uses
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs,
Graphics,
Login_c, Login_i,
Utility_c, Utility_i,
Agent_i,
MMenu, // メニューオブジェクト
CtrlForm, // 画面起動制御
CommonData, // 共有データ保持クラス
ServerAccess, // 通信ラッピング層統括クラス
MasterList, // 名称マスター管理クラス
IniFileAccess, // iniファイル管理クラス
MessageAccess, // 共通メッセージ管理クラス
LogAccess, // ログ出力制御クラス
TelephoneCommand, // 電話制御用コマンドクラス
TelephoneDataClass, // 電話制御用データクラス
ExtCtrls, jpeg, StdCtrls;

type "

str.scan(/^\s*uses\s*$(.*?)\s*,\s*(\S+)\s*;\s*^type/m) do |us|
names = $1
names.split(/,/).each do |name| # split the words(w+) only
sub_name = names.gsub(/\/*\s*(\S+)$/, "") # problem here
I think
puts " ===== sub names ======= #{ sub_name}"
# puts " >>>>>>> here uses #{ name}"
if /(\w+)/m =~ name
ref = $1
var = $1
# puts "@@@@@@@ here uses #{ var}"
if class_name
# puts " class name : #{class_name} reference class
name #{var} "
end
end
end
end

please help me abut this problem. I want to exclude or split the
comments.( japanese comment parts). I tried many combinations but still
problem.
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Maybe something to vote for...
    ... result is returned in stack and part in var parameter. ... out or ref in descriptor visible when calling the function ... If you declare a procedure or a function ...
    (borland.public.delphi.non-technical)
  • Re: Maybe something to vote for...
    ... while cur nil do ... ComputeABC(p1,p2, ref a, ref b, ref c); ... const, var, out, in descriptors. ... If you declare a procedure or a function ...
    (borland.public.delphi.non-technical)
  • Maybe something to vote for...
    ... If a function has multiple outputs ... ComputeABC(p1,p2, ref a, ref b, ref c); ... const, var, out, in descriptors. ... If you declare a procedure or a function ...
    (borland.public.delphi.non-technical)
  • Re: using TBlobfield getting "Bitmap image is not valid"
    ... I spent many hours searching for how to save a jpeg to a blob field in ... Jpg:= TJpegImage.Create; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Pass by reference
    ... I was very glad to have learned this way to do by ref. ... def change_var: ... if not var: var = MyObj ... thingref= Ref ...
    (comp.lang.python)