projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MATCH FILES, UPDATE, ADD FILES: Improve error messages.
[pspp]
/
src
/
language
/
lexer
/
macro.h
diff --git
a/src/language/lexer/macro.h
b/src/language/lexer/macro.h
index 40e8d0853405f1db7c2a053c3fed895b2b7ba927..db6edd83a9d67f14724288ef47dbb68742a5f0aa 100644
(file)
--- a/
src/language/lexer/macro.h
+++ b/
src/language/lexer/macro.h
@@
-25,6
+25,8
@@
#include "language/lexer/segment.h"
#include "language/lexer/token.h"
#include "language/lexer/segment.h"
#include "language/lexer/token.h"
+struct msg_location;
+
/* A token along with the syntax that was tokenized to produce it. The syntax
allows the token to be turned back into syntax accurately. */
struct macro_token
/* A token along with the syntax that was tokenized to produce it. The syntax
allows the token to be turned back into syntax accurately. */
struct macro_token
@@
-55,9
+57,6
@@
void macro_tokens_uninit (struct macro_tokens *);
struct macro_token *macro_tokens_add_uninit (struct macro_tokens *);
void macro_tokens_add (struct macro_tokens *, const struct macro_token *);
struct macro_token *macro_tokens_add_uninit (struct macro_tokens *);
void macro_tokens_add (struct macro_tokens *, const struct macro_token *);
-void macro_tokens_from_string (struct macro_tokens *, const struct substring,
- enum segmenter_mode);
-
void macro_tokens_to_syntax (struct macro_tokens *, struct string *,
size_t *ofs, size_t *len);
void macro_tokens_to_syntax (struct macro_tokens *, struct string *,
size_t *ofs, size_t *len);
@@
-79,12
+78,10
@@
struct macro_param
ARG_CMDEND
}
arg_type;
ARG_CMDEND
}
arg_type;
- union
- {
- int n_tokens; /* ARG_N_TOKENS. */
- struct token charend; /* ARG_CHAREND. */
- struct token enclose[2]; /* ARG_ENCLOSE. */
- };
+
+ int n_tokens; /* ARG_N_TOKENS only. */
+ struct token start; /* ARG_ENCLOSE only. */
+ struct token end; /* ARG_ENCLOSE and ARG_CHAREND only. */
};
/* A macro. */
};
/* A macro. */
@@
-94,9
+91,7
@@
struct macro
char *name;
/* Source code location of macro definition, for error reporting. */
char *name;
/* Source code location of macro definition, for error reporting. */
- char *file_name;
- int first_line;
- int last_line;
+ struct msg_location *location;
/* Parameters. */
struct macro_param *params;
/* Parameters. */
struct macro_param *params;
@@
-131,11
+126,12
@@
macro_set_is_empty (const struct macro_set *set)
struct macro_call;
int macro_call_create (const struct macro_set *, const struct token *,
struct macro_call;
int macro_call_create (const struct macro_set *, const struct token *,
- struct macro_call **);
-int macro_call_add (struct macro_call *, const struct macro_token *);
+ struct macro_call **);
+int macro_call_add (struct macro_call *, const struct macro_token *,
+ const struct msg_location *);
void macro_call_expand (struct macro_call *, enum segmenter_mode segmenter_mode,
void macro_call_expand (struct macro_call *, enum segmenter_mode segmenter_mode,
- struct macro_tokens *);
+
const struct msg_location *call_loc,
struct macro_tokens *);
void macro_call_destroy (struct macro_call *);
void macro_call_destroy (struct macro_call *);