Lines Matching refs:lines
39 def ToCAsciiArray(lines):
41 for chr in lines:
48 def ToCArray(lines):
50 for chr in lines:
55 def RemoveCommentsAndTrailingWhitespace(lines):
56 lines = re.sub(r'//.*\n', '\n', lines) # end-of-line comments
57 lines = re.sub(re.compile(r'/\*.*?\*/', re.DOTALL), '', lines) # comments.
58 lines = re.sub(r'\s+\n+', '\n', lines) # trailing whitespace
59 return lines
65 lines = file.read()
68 return lines
101 def Validate(lines, file):
102 lines = RemoveCommentsAndTrailingWhitespace(lines)
105 eval_match = EVAL_PATTERN.search(lines)
108 with_match = WITH_PATTERN.search(lines)
113 def ExpandConstants(lines, constants):
115 lines = key.sub(str(value), lines)
116 return lines
119 def ExpandMacros(lines, macros):
123 pattern_match = name_pattern.search(lines, 0)
129 assert lines[end - 1] == '('
138 while end < len(lines) and height > 0:
140 if lines[end] == ',' and height == 1:
141 add_arg(lines[last_match:end])
143 elif lines[end] in ['(', '{', '[']:
145 elif lines[end] in [')', '}', ']']:
149 add_arg(lines[last_match:end-1])
152 lines = lines[:start] + result + lines[end:]
153 pattern_match = name_pattern.search(lines, start + len(result))
154 return lines
181 def ReadMacros(lines):
184 for line in lines:
325 lines = ReadFile(filename)
326 lines = ExpandConstants(lines, consts)
327 lines = ExpandMacros(lines, macros)
328 Validate(lines, filename)
329 lines = minifier.JSMinify(lines)
332 raw_length = len(lines)
337 all_sources.append(lines)