PATCH:

Vladimir Sekissov <>
Fri Nov 22 19:39:43 CET 2002


Good day,

There is small bug in

`otp_src_R9B-0/erts/boot/src/fake_demand_epp.erl'

which prevents preprocessor to identify module declaration for
packaged module correctly.

Here is a patch. I simply copied appropriate code from `epp.erl'

Best Regards,
Vladimir Sekissov
---------------------------- cut here ---------------------------------- 
--- otp_src_R9B-0/erts/boot/src/fake_demand_epp.erl.orig	2002-10-03 03:45:12.000000000 +0600
+++ otp_src_R9B-0/erts/boot/src/fake_demand_epp.erl	2002-11-22 23:04:40.000000000 +0500
@@ -347,11 +347,20 @@
 	    wait_req_scan(St)
     end.
 
-scan_module([{'-',Lh},{atom,Lm,module},{'(',Ll},{atom,Ln,Mod},{')',Lr}|_], Ms) ->
-    Ms1 = dict:store({atom,'MODULE'}, {none,[{atom,Ln,Mod}]}, Ms),
-    dict:store({atom,'MODULE_STRING'}, {none,[{string,Ln,atom_to_list(Mod)}]},
-	       Ms1);
-scan_module(Ts, Ms) -> Ms.
+scan_module([{'-',_Lh},{atom,_Lm,module},{'(',_Ll}|Ts], Ms) ->
+    scan_module_1(Ts,[],Ms);
+scan_module(_Ts, Ms) -> Ms.
+
+scan_module_1([{atom,Ln,A},{')',_Lr}|_Ts], As, Ms) ->
+    Mod = lists:concat(lists:reverse([A|As])),
+    Ms1 = dict:store({atom,'MODULE'}, {none,[{atom,Ln,list_to_atom(Mod)}]},
+		     Ms),
+    dict:store({atom,'MODULE_STRING'}, {none,[{string,Ln,Mod}]},Ms1);
+scan_module_1([{atom,_Ln,A},{'.',_Lr}|Ts], As, Ms) ->
+    scan_module_1(Ts, [".",A|As], Ms);
+scan_module_1([{'.',_Lr}|Ts], As, Ms) ->
+    scan_module_1(Ts, As, Ms);
+scan_module_1(_Ts, _As, Ms) -> Ms.
 
 %% scan_define(Tokens, DefineLine, From, EppState)
 



More information about the erlang-questions mailing list