Author: sebastien.lelong
Date: Thu Oct  9 09:24:44 2008
New Revision: 375

Modified:
    trunk/tools/jalapi.py

Log:
convert special "--" chars within a header field as new paragraph + clean  
long dash lines so they are allowed in jal code while not displayed in  
jalapi

Modified: trunk/tools/jalapi.py
==============================================================================
--- trunk/tools/jalapi.py       (original)
+++ trunk/tools/jalapi.py       Thu Oct  9 09:24:44 2008
@@ -33,7 +33,10 @@

  def extract_comments(i,origline,content):
        doc = []
-       stillcomment = re.compile("^--\s")
+       # this regex is used to detect the end of comments,
+       # and remove the comment chars, but also to clean
+       # long-dash lines.
+       stillcomment = re.compile("^--\s-*")
        for _,line in content:
                if not stillcomment.match(line) or line.strip() == "":
                        break
@@ -53,7 +56,10 @@
        header = jsg_validator.extract_header(content)
        dhead = {}
        for field_dict in jsg_validator.FIELDS:
-               dhead[field_dict['field']] =  
jsg_validator.validate_field(header,**field_dict)
+               # Special case: when still '--' comment chars,this means new 
paragraph
+               c = jsg_validator.validate_field(header,**field_dict)
+               c = c and "".join(map(lambda c:  
re.sub("^--","\n\n",c.strip()),c.split("\n"))) or c
+               dhead[field_dict['field']] = c
        
        # now deals with procedure/function definitions
        # and global variables/constant

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to