summaryrefslogtreecommitdiffstats
path: root/src/gram.y
diff options
context:
space:
mode:
authormongo <andmarti@gmail.com>2018-03-21 10:06:36 -0300
committermongo <andmarti@gmail.com>2018-03-21 10:06:36 -0300
commitfcec375fd41e3f9a5503c82cfe17030ecd309584 (patch)
treeee7db688e6c7a92c15a963c266298b399ce4f26a /src/gram.y
parent6f5029eae048dadbb3bb6389de8393b0f4ac6b68 (diff)
changed parse_str function so can handle white spaces
Diffstat (limited to 'src/gram.y')
-rwxr-xr-xsrc/gram.y134
1 files changed, 67 insertions, 67 deletions
diff --git a/src/gram.y b/src/gram.y
index c599036..19b78b5 100755
--- a/src/gram.y
+++ b/src/gram.y
@@ -668,7 +668,7 @@ command:
plot($2, $3.left.vp->row, $3.left.vp->col, $3.right.vp->row, $3.right.vp->col);
scxfree($2);
}
-/* | S_SET STRING { parse_str(user_conf_d, $2);
+/* | S_SET STRING { parse_str(user_conf_d, $2, TRUE);
scxfree($2);
}
*/
@@ -1011,105 +1011,105 @@ setlist :
/* things that you can 'set' */
setitem :
- K_OVERLAP '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "overlap=0");
- else parse_str(user_conf_d, "overlap=1"); }
- | K_OVERLAP { parse_str(user_conf_d, "overlap=1"); }
- | K_NOOVERLAP { parse_str(user_conf_d, "overlap=0"); }
+ K_OVERLAP '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "overlap=0", TRUE);
+ else parse_str(user_conf_d, "overlap=1", TRUE); }
+ | K_OVERLAP { parse_str(user_conf_d, "overlap=1", TRUE); }
+ | K_NOOVERLAP { parse_str(user_conf_d, "overlap=0", TRUE); }
| K_AUTOBACKUP '=' NUMBER {
char cmd[MAXCMD];
sprintf(cmd, "autobackup=%d", $3);
- parse_str(user_conf_d, cmd); }
- | K_NOAUTOBACKUP { parse_str(user_conf_d, "autobackup=0"); }
- | K_AUTOCALC { parse_str(user_conf_d, "autocalc=1"); }
- | K_AUTOCALC '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "autocalc=0");
- else parse_str(user_conf_d, "autocalc=1"); }
- | K_NOAUTOCALC { parse_str(user_conf_d, "autocalc=0"); }
- | K_DEBUG { parse_str(user_conf_d, "debug=1"); }
- | K_DEBUG '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "debug=0");
- else parse_str(user_conf_d, "debug=1"); }
- | K_NODEBUG { parse_str(user_conf_d, "debug=0"); }
- | K_TRG { parse_str(user_conf_d, "trigger=1"); }
- | K_TRG '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "trigger=0");
- else parse_str(user_conf_d, "trigger=1"); }
- | K_NOTRG { parse_str(user_conf_d, "trigger=0"); }
- | K_EXTERNAL_FUNCTIONS { parse_str(user_conf_d, "external_functions=1"); }
+ parse_str(user_conf_d, cmd, TRUE); }
+ | K_NOAUTOBACKUP { parse_str(user_conf_d, "autobackup=0", TRUE); }
+ | K_AUTOCALC { parse_str(user_conf_d, "autocalc=1", TRUE); }
+ | K_AUTOCALC '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "autocalc=0", TRUE);
+ else parse_str(user_conf_d, "autocalc=1", TRUE); }
+ | K_NOAUTOCALC { parse_str(user_conf_d, "autocalc=0", TRUE); }
+ | K_DEBUG { parse_str(user_conf_d, "debug=1", TRUE); }
+ | K_DEBUG '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "debug=0", TRUE);
+ else parse_str(user_conf_d, "debug=1", TRUE); }
+ | K_NODEBUG { parse_str(user_conf_d, "debug=0", TRUE); }
+ | K_TRG { parse_str(user_conf_d, "trigger=1", TRUE); }
+ | K_TRG '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "trigger=0", TRUE);
+ else parse_str(user_conf_d, "trigger=1", TRUE); }
+ | K_NOTRG { parse_str(user_conf_d, "trigger=0", TRUE); }
+ | K_EXTERNAL_FUNCTIONS { parse_str(user_conf_d, "external_functions=1", TRUE); }
| K_EXTERNAL_FUNCTIONS '=' NUMBER {
- if ($3 == 0) parse_str(user_conf_d, "external_functions=0");
- else parse_str(user_conf_d, "external_functions=1"); }
- | K_NOEXTERNAL_FUNCTIONS { parse_str(user_conf_d, "external_functions=0"); }
- | K_HALF_PAGE_SCROLL { parse_str(user_conf_d, "half_page_scroll=1"); }
+ if ($3 == 0) parse_str(user_conf_d, "external_functions=0", TRUE);
+ else parse_str(user_conf_d, "external_functions=1", TRUE); }
+ | K_NOEXTERNAL_FUNCTIONS { parse_str(user_conf_d, "external_functions=0", TRUE); }
+ | K_HALF_PAGE_SCROLL { parse_str(user_conf_d, "half_page_scroll=1", TRUE); }
| K_HALF_PAGE_SCROLL '=' NUMBER
- { if ($3 == 0) parse_str(user_conf_d, "half_page_scroll=0");
- else parse_str(user_conf_d, "half_page_scroll=1"); }
- | K_NOHALF_PAGE_SCROLL { parse_str(user_conf_d, "half_page_scroll=0"); }
- | K_QUIT_AFTERLOAD { parse_str(user_conf_d, "quit_afterload=1"); }
+ { if ($3 == 0) parse_str(user_conf_d, "half_page_scroll=0", TRUE);
+ else parse_str(user_conf_d, "half_page_scroll=1", TRUE); }
+ | K_NOHALF_PAGE_SCROLL { parse_str(user_conf_d, "half_page_scroll=0", TRUE); }
+ | K_QUIT_AFTERLOAD { parse_str(user_conf_d, "quit_afterload=1", TRUE); }
| K_QUIT_AFTERLOAD '=' NUMBER
- { if ($3 == 0) parse_str(user_conf_d, "quit_afterload=0");
- else parse_str(user_conf_d, "quit_afterload=1"); }
- | K_NOQUIT_AFTERLOAD { parse_str(user_conf_d, "quit_afterload=0"); }
- | K_XLSX_READFORMULAS { parse_str(user_conf_d, "xlsx_readformulas=1"); }
+ { if ($3 == 0) parse_str(user_conf_d, "quit_afterload=0", TRUE);
+ else parse_str(user_conf_d, "quit_afterload=1", TRUE); }
+ | K_NOQUIT_AFTERLOAD { parse_str(user_conf_d, "quit_afterload=0", TRUE); }
+ | K_XLSX_READFORMULAS { parse_str(user_conf_d, "xlsx_readformulas=1", TRUE); }
| K_XLSX_READFORMULAS '=' NUMBER
- { if ($3 == 0) parse_str(user_conf_d, "xlsx_readformulas=0");
- else parse_str(user_conf_d, "xlsx_readformulas=1"); }
- | K_NOXLSX_READFORMULAS { parse_str(user_conf_d, "xlsx_readformulas=0"); }
- | K_NOCURSES { parse_str(user_conf_d, "nocurses=1"); }
- | K_NOCURSES '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "nocurses=0");
- else parse_str(user_conf_d, "nocurses=1"); }
- | K_CURSES { parse_str(user_conf_d, "nocurses=0"); }
- | K_NUMERIC { parse_str(user_conf_d, "numeric=1"); }
- | K_NUMERIC '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "numeric=0");
- else parse_str(user_conf_d, "numeric=1"); }
- | K_NONUMERIC { parse_str(user_conf_d, "numeric=0"); }
- | K_IGNORECASE { parse_str(user_conf_d, "ignorecase=1"); }
- | K_IGNORECASE '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "ignorecase=0");
- else parse_str(user_conf_d, "ignorecase=1"); }
- | K_NOIGNORECASE { parse_str(user_conf_d, "ignorecase=0"); }
- | K_NUMERIC_DECIMAL { parse_str(user_conf_d, "numeric_decimal=1"); }
+ { if ($3 == 0) parse_str(user_conf_d, "xlsx_readformulas=0", TRUE);
+ else parse_str(user_conf_d, "xlsx_readformulas=1", TRUE); }
+ | K_NOXLSX_READFORMULAS { parse_str(user_conf_d, "xlsx_readformulas=0", TRUE); }
+ | K_NOCURSES { parse_str(user_conf_d, "nocurses=1", TRUE); }
+ | K_NOCURSES '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "nocurses=0", TRUE);
+ else parse_str(user_conf_d, "nocurses=1", TRUE); }
+ | K_CURSES { parse_str(user_conf_d, "nocurses=0", TRUE); }
+ | K_NUMERIC { parse_str(user_conf_d, "numeric=1", TRUE); }
+ | K_NUMERIC '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "numeric=0", TRUE);
+ else parse_str(user_conf_d, "numeric=1", TRUE); }
+ | K_NONUMERIC { parse_str(user_conf_d, "numeric=0", TRUE); }
+ | K_IGNORECASE { parse_str(user_conf_d, "ignorecase=1", TRUE); }
+ | K_IGNORECASE '=' NUMBER { if ($3 == 0) parse_str(user_conf_d, "ignorecase=0", TRUE);
+ else parse_str(user_conf_d, "ignorecase=1", TRUE); }
+ | K_NOIGNORECASE { parse_str(user_conf_d, "ignorecase=0", TRUE); }
+ | K_NUMERIC_DECIMAL { parse_str(user_conf_d, "numeric_decimal=1", TRUE); }
| K_NUMERIC_DECIMAL '=' NUMBER
- { if ($3 == 0) parse_str(user_conf_d, "numeric_decimal=0");
- else parse_str(user_conf_d, "numeric_decimal=1"); }
- | K_NONUMERIC_DECIMAL { parse_str(user_conf_d, "numeric_decimal=0"); }
- | K_NUMERIC_ZERO { parse_str(user_conf_d, "numeric_zero=1"); }
+ { if ($3 == 0) parse_str(user_conf_d, "numeric_decimal=0", TRUE);
+ else parse_str(user_conf_d, "numeric_decimal=1", TRUE); }
+ | K_NONUMERIC_DECIMAL { parse_str(user_conf_d, "numeric_decimal=0", TRUE); }
+ | K_NUMERIC_ZERO { parse_str(user_conf_d, "numeric_zero=1", TRUE); }
| K_NUMERIC_ZERO '=' NUMBER
- { if ($3 == 0) parse_str(user_conf_d, "numeric_zero=0");
- else parse_str(user_conf_d, "numeric_zero=1"); }
- | K_NONUMERIC_ZERO { parse_str(user_conf_d, "numeric_zero=0"); }
- | K_NEWLINE_ACTION { parse_str(user_conf_d, "newline_action=0"); }
+ { if ($3 == 0) parse_str(user_conf_d, "numeric_zero=0", TRUE);
+ else parse_str(user_conf_d, "numeric_zero=1", TRUE); }
+ | K_NONUMERIC_ZERO { parse_str(user_conf_d, "numeric_zero=0", TRUE); }
+ | K_NEWLINE_ACTION { parse_str(user_conf_d, "newline_action=0", TRUE); }
| K_NEWLINE_ACTION '=' WORD {
char * s = (char *) $3;
- if (s[0] =='j') parse_str(user_conf_d, "newline_action=j");
+ if (s[0] =='j') parse_str(user_conf_d, "newline_action=j", TRUE);
else if (s[0] =='l')
- parse_str(user_conf_d, "newline_action=l");
+ parse_str(user_conf_d, "newline_action=l", TRUE);
}
| K_DEFAULT_COPY_TO_CLIPBOARD_CMD '=' strarg {
char cmd[MAXCMD];
char * s = (char *) $3;
sprintf(cmd, "default_copy_to_clipboard_cmd=%s", s);
- parse_str(user_conf_d, cmd);
+ parse_str(user_conf_d, cmd, FALSE);
scxfree(s);
}
| K_DEFAULT_PASTE_FROM_CLIPBOARD_CMD '=' strarg {
char cmd[MAXCMD];
char * s = (char *) $3;
sprintf(cmd, "default_paste_from_clipboard_cmd=%s", s);
- parse_str(user_conf_d, cmd);
+ parse_str(user_conf_d, cmd, FALSE);
scxfree(s);
}
- | K_COPY_TO_CLIPBOARD_DELIMITED_TAB { parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=1"); }
+ | K_COPY_TO_CLIPBOARD_DELIMITED_TAB { parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=1", TRUE); }
| K_COPY_TO_CLIPBOARD_DELIMITED_TAB '=' NUMBER
- { if ($3 == 0) parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=0");
- else parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=1"); }
- | K_NOCOPY_TO_CLIPBOARD_DELIMITED_TAB { parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=0"); }
+ { if ($3 == 0) parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=0", TRUE);
+ else parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=1", TRUE); }
+ | K_NOCOPY_TO_CLIPBOARD_DELIMITED_TAB { parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=0", TRUE); }
| K_NEWLINE_ACTION '=' NUMBER {
- if ($3 == 0) parse_str(user_conf_d, "newline_action=0"); }
- | K_TM_GMTOFF { parse_str(user_conf_d, "tm_gmtoff=-10800"); }
+ if ($3 == 0) parse_str(user_conf_d, "newline_action=0", TRUE); }
+ | K_TM_GMTOFF { parse_str(user_conf_d, "tm_gmtoff=-10800", TRUE); }
| K_TM_GMTOFF '=' num {
char * s = scxmalloc((unsigned) BUFFERSIZE);
sprintf(s, "tm_gmtoff=%d", (int) $3);
- parse_str(user_conf_d, s);
+ parse_str(user_conf_d, s, TRUE);
scxfree(s);
}