summaryrefslogtreecommitdiffstats
path: root/tests/009
Commit message (Collapse)AuthorAgeFilesLines
* Count East Asian Wide and Full Fidth chars as two columns.Kaz Kylheku2015-08-101-2/+2
| | | | | | | | | | | | | | | | | * regex.c (create_wide_cs): New static function. (wide_display_char_p): New function. * regex.h (wide_display_char_p): Declared. * stream.c (put_string, put_char): Use wide_display_char_p to determine whether an extra column need be counted. Also bugfix: iswprint evidently cannot be relied to work over the entire Unicode range, at least not in the C locale. Glibc's version and is reporting valid Japanese characters as unprintable on Ubuntu. As a hack we instead check for control characters and invert the result: control chars are unprintable. * tests/009/json.expected: Updated.
* * stream.c (indent_mode_put_string): Function removed,Kaz Kylheku2015-08-041-47/+47
| | | | | | | logic hoisted into put_string. (put_string, put_char): Always count column, indent mode or not. * tests/009/json.expected: Updated.
* Multi-line, indented printing of structure.Kaz Kylheku2015-07-311-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c (op_error): New static function. (macro_form_p, fboundp): Static to external. (special_operator_p): New function. (eval_init): Register macrolet and symacrolet to op_error. These are recognized and processed by expand, but we want them in the op table so they are reported by special_operator_p. * eval.h (fboundp, macro_form_p, special_operator_p): Declared. * hash.c (print_key_val): Break long lines on spaces between pairs with stream_width_check. (hash_print_op): Implement split and indented printing. * lib.c (obj_print_impl): New static function, resulting from a merge of obj_print and obj_pprint. Fixes some wrong-way recursion bugs: obj_pprint recursed into obj_print in some places. Adds support for multi-line printing of vectors and lists, with indentation using the new interfaces in streams. * stream.c (strm_base_init): Update initializer. (put_indent, indent_mode_put_string): New static functions. (put_string): Use indent_mode_put_string in either of the two indent modes. (put_char): Implement indent mode. (get_indent_mode, test_set_indent_mode, set_indent_mode, get_indent, set_indent, inc_indent, width_check): New functions. * stream.h (enum indent_mode): New. (struct strm_base): indent_on member becomes indent_mode. New members data_width and code_width. (get_indent_mode, test_set_indent_mode, set_indent_mode, get_indent, set_indent, inc_indent, width_check): Declared. * tests/009/json.expected: Updated. * tests/010/seq.expected: Likewise. * tests/011/macros-2.expected: Likewise.
* * parser.l: Allowing ^ to be a quote character, and adjusting definitionKaz Kylheku2014-03-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of identifiers to rule this out from being the first character of a symbol which has no prefix. Recognize the ^ character as a token in the NESTED state. * lib.c (obj_print, obj_pprint): Render sys:qquote as ^. * parser.y (choose_quote): Function removed. (n_expr): Recognize '^' as quasiquote. Removed all the "smart quote" hacks that try to make quote behave as quote or quasiquote, or try to cancel out unquotes and quotes. * tests/009/json.txr: Fixed to ^ quasiquote. * tests/010/reghash.txr: Likewise. * tests/011/macros-2.txr: Likewise. * tests/011/mandel.txr: Likewise. * tests/011/special-1.txr: Likewise. * txr.1: Updated docs. * genvim.txr: Revamped definitions for txr_ident and txl_ident so that unqualified identifiers cannot start with # or ^, but ones with @ or : in front can start with these characters. * txr.vim: Regenerated.
* * stream.c (vformat): Compensate for differences in printfKaz Kylheku2012-03-271-1/+1
| | | | | | | implementations with regard to printing floating point exponents. by deleting any plus sign and leading zeros after the 'e'. * tests/009/json.expected: Regenerated.
* * Makefile (TXR_ARGS): Pass new file to tests/009/json.txr test.Kaz Kylheku2012-03-233-17/+117
| | | | | | | | | | * tests/009/json.expected: Updated. * tests/009/json.txr: Updated source. Translates to a more native representation with vectors and hash tables. Numbers go to floating point instead of remaining as strings. * tests/009/pass1.json: New file: a test case from json.org.
* Added a JSON parsing test case. This flushed out a bug which crashedKaz Kylheku2011-11-183-0/+147
the garbage collector (uninitialized fields in function objects). * Makefile: Defined TXR_ARGS and TXR_OPTS for new test case. * hash.c (hash_begin): Construction of cobj modified to obey the correct procedure described in HACKING. * lib.c (func_n3, func_n4): These functions neglected to initialize the env member of the function structure. * tests/009/json.expected: New file. * tests/009/json.txr: New file. * tests/009/webapp.json: New file.