Lines Matching defs:line

86  *			Try to parse the given line as a variable assignment.
220 * The target to be made if no targets are specified in the command line.
227 * active dependency line, or NULL if the current line does not belong to a
228 * dependency line, for example because it is a variable assignment.
246 * is seen, then set to each successive source on the line.
254 * the command line, followed by the included files or .for loops, up to and
439 /* entry->lineno is not a useful line number */
445 /* Check if the current character is escaped on the current line. */
447 IsEscaped(const char *line, const char *p)
450 while (p > line && *--p == '\\')
511 (void)fprintf(f, "\"%s\" line %u: ", fname, lineno);
525 (void)fprintf(f, "\"%s/%s\" line %u: ", dir.str, base.str, lineno);
690 * dependency line, since each of these dependency groups has
790 * In a line like ".MAIN: source1 source2", add all sources to the list of
792 * command line and .MAIN occurs for the first time.
852 * Given the name of a source in a dependency line, figure out if it is an
875 * user input, we want the first target on the first dependency line that is
898 InvalidLineType(const char *line, const char *unexpanded_line)
909 } else if (strcmp(line, unexpanded_line) == 0)
910 Parse_Error(PARSE_FATAL, "Invalid line '%s'", line);
913 "Invalid line '%s', expanded to '%s'",
914 unexpanded_line, line);
962 * Allow targets from the command line to override the
1149 * In a dependency line like 'targets: sources' or 'targets! sources', parse
1255 * line options.
1300 /* Handle a "dependency" line like '.SPECIAL:' without any sources. */
1349 * something like suffixes, we take each space-separated word on the line as
1502 * rest of the line is the value.
1565 * From a dependency line like 'targets: sources', parse the sources.
1621 * Parse a dependency line consisting of targets, followed by a dependency
1739 * Used for both lines in a file and command line arguments.
2172 DEBUG3(PARSE, "Parse_PushInput: %s %s, line %u\n",
2211 /* Check if the line is a SYSV include directive. */
2213 IsSysVInclude(const char *line)
2217 if (!IsInclude(line, true))
2220 /* Avoid interpreting a dependency line as an include */
2221 for (p = line; (p = strchr(p, ':')) != NULL;) {
2223 /* end of line -> it's a dependency */
2234 /* Push to another file. The line points to the word "include". */
2236 ParseTraditionalInclude(char *line)
2240 bool silent = line[0] != 'i';
2241 char *file = line + (silent ? 8 : 7);
2252 /* Skip to end of line or next whitespace */
2269 ParseGmakeExport(char *line)
2271 char *variable = line + 6;
2345 DEBUG2(PARSE, "ParseEOF: returning to file %s, line %u\n",
2359 * Parse until the end of a line, taking into account lines that end with
2360 * backslash-newline. The resulting line goes from out_line to out_line_end;
2361 * the line is not null-terminated.
2367 char *line = curFile->buf_ptr;
2369 char *p = line;
2370 char *line_end = line;
2415 !(p > line && p[-1] == '['))
2428 *out_line = line;
2440 UnescapeBackslash(char *line, char *start)
2444 char *spaceStart = line;
2463 if (ch == '#' && line[0] != '\t')
2472 /* Keep an escaped ' ' at the line end. */
2485 * Return the next line that is neither empty nor a comment.
2486 * Backslash line continuations are folded into a single space.
2492 * Return the next line, even if it is empty or a comment.
2493 * Preserve backslash-newline to keep the line numbers correct.
2501 * Return the next line that starts with a dot.
2502 * Backslash line continuations are folded into a single space.
2512 * Return the next "interesting" logical line from the current file. The
2520 char *line;
2528 &line, &line_end, &firstBackslash, &commentLineEnd);
2532 if (line == line_end || line == commentLineEnd) {
2539 /* We now have a line of data */
2544 return line; /* Don't join the physical lines. */
2546 if (kind == LK_DOT && line[0] != '.')
2551 if (commentLineEnd != NULL && line[0] != '\t')
2554 UnescapeBackslash(line, firstBackslash);
2555 return line;
2561 const char *line;
2563 while ((line = ReadLowLevelLine(LK_DOT)) != NULL)
2564 if (Cond_EvalLine(line) == CR_TRUE)
2570 ParseForLoop(const char *line)
2577 rval = For_Eval(line);
2579 return false; /* Not a .for line */
2581 return true; /* Syntax error - error printed, ignore line */
2589 line = ReadLowLevelLine(LK_FOR_BODY);
2590 if (line == NULL) {
2595 } while (For_Accum(line, &forLevel));
2602 * Read an entire line from the input file.
2608 * Return a line without trailing whitespace, or NULL for EOF. The returned
2614 char *line;
2619 line = ReadLowLevelLine(LK_NONEMPTY);
2624 if (line == NULL)
2627 DEBUG2(PARSE, "Parsing line %u: %s\n", curFile->lineno, line);
2629 && ((curFile->guardState == GS_START && line[0] != '.')
2632 if (line[0] != '.')
2633 return line;
2635 condResult = Cond_EvalLine(line);
2639 && (guard = Cond_ExtractGuard(line)) != NULL) {
2652 case CR_ERROR: /* Not a conditional line */
2653 if (ParseForLoop(line))
2657 return line;
2734 * See if the line starts with one of the known directives, and if so, handle
2738 ParseDirective(char *line)
2740 char *p = line + 1;
2787 Parse_VarAssign(const char *line, bool finishDependencyGroup, GNode *scope)
2791 if (!Parse_IsVar(line, &var))
2839 ParseDependencyLine(char *line)
2846 char *semicolon = FindSemicolon(line);
2855 * We now know it's a dependency line, so it needs to have all
2858 * XXX: Ideally the dependency line would first be split into
2865 * Parsing the line first would also prevent that targets
2888 expanded_line = Var_Subst(line, SCOPE_CMDLINE, emode);
2896 ParseDependency(expanded_line, line);
2904 ParseLine(char *line)
2906 if (line[0] == '.' && ParseDirective(line))
2909 if (line[0] == '\t') {
2910 ParseLine_ShellCommand(line + 1);
2914 if (IsSysVInclude(line)) {
2915 ParseTraditionalInclude(line);
2919 if (strncmp(line, "export", 6) == 0 && ch_isspace(line[6]) &&
2920 strchr(line, ':') == NULL) {
2921 ParseGmakeExport(line);
2925 if (Parse_VarAssign(line, true, SCOPE_GLOBAL))
2930 ParseDependencyLine(line);
2937 char *line;
2949 while ((line = ReadHighLevelLine()) != NULL) {
2950 ParseLine(line);