Lines Matching defs:line
22 # Invoke with two command-line parameters:
365 Returns a tuple (type, line, ...).
367 for line in in_file:
368 line = line.strip()
369 if not line: continue
370 if line.startswith("#"): # whole-line comment
373 match = _missing_re.match(line)
377 yield ("missing", line, fields)
379 match = _missing2_re.match(line)
382 # parse the remainder of the line like regular data.
384 line = match.group(1)
386 if want_comments: yield ("comment", line)
388 comment_start = line.find("#") # inline comment
390 line = line[:comment_start].rstrip()
391 if not line: continue
392 fields = line.split(";")
400 yield ("range", line, start, end, fields)
405 yield ("range", line, c, c, fields)
408 yield ("other", line, fields)
410 raise SyntaxError("unable to parse line\n %s\n" % line)
443 # Match a comment line like
454 "Catalog": "??", # Must be specified, e.g., in @missing line.
463 line = data[1]
464 match = _ucd_version_re.match(line)
468 words = line[1:].lstrip().split()
596 # (i.e., the @missing line would be the only reason to parse such a file)
605 if "gc" not in _defaults: # No @missing line in any .txt file?
660 (line, c, end, fields) = (data[1], data[2], data[3], data[4])
670 range_first_line = line
676 line)
680 (range_first_line, line))
686 (range_first_line, line))
723 raise SyntaxError("error: numeric values differ at\n %s\n" % line)
775 for line in in_file:
776 line = line.strip()
777 if not line: continue
778 match = _names_h1_re.match(line)
786 match = _names_h2_re.match(line)
791 match = _names_char_re.match(line)
903 # Ignore the @missing line which has an incorrect number of fields,
1477 for line in in_file:
1478 orig_line = line
1479 if line.startswith("# For documentation"):
1480 out_file.write(line)
1499 if line[0] in "#\r\n":
1500 out_file.write(line)
1502 for rep in _idna_replacements: line = rep[0].sub(rep[1], line)
1504 comment_pos = line.find("#", 1)
1506 line = (line[:comment_pos] + ((40 - comment_pos) * ' ') +
1507 line[comment_pos:])
1510 while space_pos > 0 and line[space_pos - 1] == ' ':
1515 line = line[:40] + line[comment_pos:]
1519 line = line[:space_pos] + " " + line[comment_pos:]
1520 # Write the modified line.
1521 out_file.write(line)
1522 if "..FFFF" in orig_line and "..FFFC" in line:
1537 for line in in_file:
1538 match = _strip_re.match(line)
1540 line = match.group(1)
1542 line = line.rstrip()
1544 match = _code_point_re.match(line)
1547 data = line[match.end() - 1:]
1561 # no data on this line, output as is
1562 out_file.write(line)
1565 # data on this line, store for possible range compaction
1567 # set as the first line in a possible range
1577 # Only strip, don't merge: just output the stripped line.
1578 out_file.write(line)
1603 data lines into one line with range syntax.
1902 # Sample line to match:
1907 # Sample line to match:
1911 # Sample line to match:
1915 # Sample line to match:
1919 # Sample line to match:
1923 # Sample line to match:
1927 # Sample line to match:
1932 # Sample line to match if it has matched _prop_and_value_re
1944 for line in uchar_file:
1948 if "enum UCharCategory" in line:
1953 if line.startswith("}"):
1956 match = _gc_comment_re.match(line)
1960 match = _gc_re.match(line)
1969 if "enum UCharDirection {" in line:
1974 if line.startswith("}"):
1977 match = _bc_comment_re.match(line)
1981 match = _bc_re.match(line)
1992 match = _uchar_re.match(line)
2003 match = _ublock_re.match(line)
2013 match = _prop_and_value_re.match(line)
2016 if vname == "COUNT" or _prop_and_alias_re.match(line):
2054 # Sample line to match:
2064 for line in uscript_file:
2065 match = _uscript_re.match(line)
2216 # from a @missing line. "nv" = "null value".