1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

modifier, psyc-mode fix

This commit is contained in:
tg(x) 2012-02-15 22:39:19 +01:00
parent a2e54dfdd0
commit 545ee184a1
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;