modifier, psyc-mode fix

This commit is contained in:
Gabor Adam Toth 2012-02-15 22:39:19 +01:00
parent 632616a2fb
commit 2a7778f868
4 changed files with 14 additions and 3 deletions

View File

@ -41,7 +41,7 @@
psyc-elem-name (concat psyc-elem-start "=" psyc-kw)
psyc-elem-type (concat psyc-elem-start "=" psyc-types "\\b")
psyc-elem-name-delim (concat psyc-elem-name "\\(:\\)") ;2
psyc-elem-len (concat "\\(?:" psyc-elem-name-delim "\\)?" psyc-num) ;3
psyc-elem-len (concat psyc-elem-start "\\(?:=" psyc-kw ":\\)?" psyc-num) ;2
psyc-update-op (concat "^@" psyc-kw psyc-mod-delim ".+ " psyc-op) ;3
psyc-update-name (concat "^@" psyc-kw psyc-mod-delim ".+ "
@ -91,7 +91,7 @@
(,psyc-elem-name . (1 font-lock-variable-name-face))
(,psyc-elem-type . (1 font-lock-type-face t))
(,psyc-elem-name-delim . (2 font-lock-comment-face))
(,psyc-elem-len . (3 font-lock-constant-face))
(,psyc-elem-len . (2 font-lock-constant-face))
(,psyc-elem-delim . (0 font-lock-keyword-face))
(,psyc-update-op . (3 font-lock-preprocessor-face))

View File

@ -198,6 +198,14 @@ typedef struct {
char oper;
} PsycModifier;
#define PSYC_MODIFIER(op, nam, val, flg) \
(PsycModifier) { \
.oper = op, \
.name = nam, \
.value = val, \
.flag = flg, \
}
/** Entity or routing header */
typedef struct {
size_t lines;

View File

@ -51,6 +51,9 @@ static inline
PsycRenderRC
psyc_render (PsycPacket *packet, char *buffer, size_t buflen);
size_t
psyc_render_modifier (PsycModifier *mod, char *buffer);
PsycRenderRC
psyc_render_elem (PsycElem *elem, char *buffer, size_t buflen);

View File

@ -115,7 +115,7 @@ psyc_render_dict (PsycDict *dict, char *buffer, size_t buflen)
return PSYC_RENDER_SUCCESS;
}
static inline size_t
inline size_t
psyc_render_modifier (PsycModifier *mod, char *buffer)
{
size_t cur = 0;