summaryrefslogtreecommitdiffstats
path: root/tests/009
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-07-31 06:15:16 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-07-31 06:15:16 -0700
commitdbbfc2c41a3710bc64df7b477fcfa536da79233f (patch)
treee4527f7c82e8304c59b71792b10ee240f98eae61 /tests/009
parentab1a633e67d04bb36b2b00461e1a72a786bab917 (diff)
downloadtxr-dbbfc2c41a3710bc64df7b477fcfa536da79233f.tar.gz
txr-dbbfc2c41a3710bc64df7b477fcfa536da79233f.tar.bz2
txr-dbbfc2c41a3710bc64df7b477fcfa536da79233f.zip
Multi-line, indented printing of structure.
* 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.
Diffstat (limited to 'tests/009')
-rw-r--r--tests/009/json.expected51
1 files changed, 49 insertions, 2 deletions
diff --git a/tests/009/json.expected b/tests/009/json.expected
index f0d5fcd3..643ed5b7 100644
--- a/tests/009/json.expected
+++ b/tests/009/json.expected
@@ -1,8 +1,55 @@
-AST: #H((:equal-based) ("web-app" #H((:equal-based) ("servlet-mapping" #H((:equal-based) ("cofaxTools" "/tools/*") ("cofaxCDS" "/") ("cofaxAdmin" "/admin/*") ("cofaxEmail" "/cofaxutil/aemail/*") ("fileServlet" "/static/*"))) ("servlet" #(#H((:equal-based) ("servlet-class" "org.cofax.cds.CDSServlet") ("init-param" #H((:equal-based) ("defaultFileTemplate" "articleTemplate.htm") ("configGlossary:installationAt" "Philadelphia, PA") ("templateOverridePath" "") ("dataStoreLogLevel" "debug") ("searchEngineListTemplate" "forSearchEnginesList.htm") ("dataStoreClass" "org.cofax.SqlDataStore") ("configGlossary:poweredBy" "Cofax") ("jspFileTemplate" "articleTemplate.jsp") ("cacheTemplatesTrack" 100.0) ("cacheTemplatesStore" 50.0) ("templateProcessorClass" "org.cofax.WysiwygTemplate") ("dataStoreUser" "sa") ("redirectionClass" "org.cofax.SqlRedirection") ("dataStoreConnUsageLimit" 100.0) ("dataStoreMaxConns" 100.0) ("jspListTemplate" "listTemplate.jsp") ("useJSP" :false) ("configGlossary:poweredByIcon" "/images/cofax.gif") ("templateLoaderClass" "org.cofax.FilesTemplateLoader") ("cacheTemplatesRefresh" 15.0) ("cachePagesDirtyRead" 10.0) ("searchEngineRobotsDb" "WEB-INF/robots.db") ("cachePagesStore" 100.0) ("dataStoreTestQuery" "SET NOCOUNT ON;select test='test';") ("configGlossary:adminEmail" "ksm@pobox.com") ("configGlossary:staticPath" "/content/static") ("dataStoreInitConns" 10.0) ("cachePagesTrack" 200.0) ("dataStorePassword" "dataStoreTestQuery") ("defaultListTemplate" "listTemplate.htm") ("dataStoreLogFile" "/usr/local/tomcat/logs/datastore.log") ("maxUrlLength" 500.0) ("dataStoreDriver" "com.microsoft.jdbc.sqlserver.SQLServerDriver") ("dataStoreName" "cofax") ("cachePackageTagsRefresh" 60.0) ("templatePath" "templates") ("dataStoreUrl" "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon") ("useDataStore" :true) ("cachePackageTagsTrack" 200.0) ("searchEngineFileTemplate" "forSearchEngines.htm") ("cachePackageTagsStore" 200.0) ("cachePagesRefresh" 10.0))) ("servlet-name" "cofaxCDS")) #H((:equal-based) ("servlet-class" "org.cofax.cds.EmailServlet") ("init-param" #H((:equal-based) ("mailHost" "mail1") ("mailHostOverride" "mail2"))) ("servlet-name" "cofaxEmail")) #H((:equal-based) ("servlet-class" "org.cofax.cds.AdminServlet") ("servlet-name" "cofaxAdmin")) #H((:equal-based) ("servlet-class" "org.cofax.cds.FileServlet") ("servlet-name" "fileServlet")) #H((:equal-based) ("servlet-class" "org.cofax.cms.CofaxToolsServlet") ("init-param" #H((:equal-based) ("lookInContext" 1.0) ("removePageCache" "/content/admin/remove?cache=pages&id=") ("logMaxSize" "") ("dataLogMaxSize" "") ("removeTemplateCache" "/content/admin/remove?cache=templates&id=") ("dataLog" 1.0) ("logLocation" "/usr/local/tomcat/logs/CofaxTools.log") ("log" 1.0) ("adminGroupID" 4.0) ("templatePath" "toolstemplates/") ("betaServer" :true) ("dataLogLocation" "/usr/local/tomcat/logs/dataLog.log") ("fileTransferFolder" "/usr/local/tomcat/webapps/content/fileTransferFolder"))) ("servlet-name" "cofaxTools")))) ("taglib" #H((:equal-based) ("taglib-uri" "cofax.tld") ("taglib-location" "/WEB-INF/tlds/cofax.tld"))))))
+AST: #H((:equal-based) ("web-app" #H((:equal-based) ("servlet-mapping" #H((:equal-based) ("cofaxTools" "/tools/*") ("cofaxCDS" "/") ("cofaxAdmin" "/admin/*")
+ ("cofaxEmail" "/cofaxutil/aemail/*") ("fileServlet" "/static/*")))
+ ("servlet" #(#H((:equal-based) ("servlet-class" "org.cofax.cds.CDSServlet") ("init-param" #H((:equal-based) ("defaultFileTemplate" "articleTemplate.htm")
+ ("configGlossary:installationAt" "Philadelphia, PA") ("templateOverridePath" "")
+ ("dataStoreLogLevel" "debug") ("searchEngineListTemplate" "forSearchEnginesList.htm")
+ ("dataStoreClass" "org.cofax.SqlDataStore") ("configGlossary:poweredBy" "Cofax")
+ ("jspFileTemplate" "articleTemplate.jsp") ("cacheTemplatesTrack" 100.0)
+ ("cacheTemplatesStore" 50.0) ("templateProcessorClass" "org.cofax.WysiwygTemplate")
+ ("dataStoreUser" "sa") ("redirectionClass" "org.cofax.SqlRedirection")
+ ("dataStoreConnUsageLimit" 100.0) ("dataStoreMaxConns" 100.0)
+ ("jspListTemplate" "listTemplate.jsp") ("useJSP" :false) ("configGlossary:poweredByIcon" "/images/cofax.gif")
+ ("templateLoaderClass" "org.cofax.FilesTemplateLoader") ("cacheTemplatesRefresh" 15.0)
+ ("cachePagesDirtyRead" 10.0) ("searchEngineRobotsDb" "WEB-INF/robots.db")
+ ("cachePagesStore" 100.0) ("dataStoreTestQuery" "SET NOCOUNT ON;select test='test';")
+ ("configGlossary:adminEmail" "ksm@pobox.com") ("configGlossary:staticPath" "/content/static")
+ ("dataStoreInitConns" 10.0) ("cachePagesTrack" 200.0) ("dataStorePassword" "dataStoreTestQuery")
+ ("defaultListTemplate" "listTemplate.htm") ("dataStoreLogFile" "/usr/local/tomcat/logs/datastore.log")
+ ("maxUrlLength" 500.0) ("dataStoreDriver" "com.microsoft.jdbc.sqlserver.SQLServerDriver")
+ ("dataStoreName" "cofax") ("cachePackageTagsRefresh" 60.0) ("templatePath" "templates")
+ ("dataStoreUrl" "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon")
+ ("useDataStore" :true) ("cachePackageTagsTrack" 200.0) ("searchEngineFileTemplate" "forSearchEngines.htm")
+ ("cachePackageTagsStore" 200.0) ("cachePagesRefresh" 10.0)))
+ ("servlet-name" "cofaxCDS")) #H((:equal-based) ("servlet-class" "org.cofax.cds.EmailServlet")
+ ("init-param" #H((:equal-based) ("mailHost" "mail1") ("mailHostOverride" "mail2")))
+ ("servlet-name" "cofaxEmail"))
+ #H((:equal-based) ("servlet-class" "org.cofax.cds.AdminServlet")
+ ("servlet-name" "cofaxAdmin")) #H((:equal-based) ("servlet-class" "org.cofax.cds.FileServlet")
+ ("servlet-name" "fileServlet"))
+ #H((:equal-based) ("servlet-class" "org.cofax.cms.CofaxToolsServlet")
+ ("init-param" #H((:equal-based) ("lookInContext" 1.0) ("removePageCache" "/content/admin/remove?cache=pages&id=")
+ ("logMaxSize" "") ("dataLogMaxSize" "") ("removeTemplateCache" "/content/admin/remove?cache=templates&id=")
+ ("dataLog" 1.0) ("logLocation" "/usr/local/tomcat/logs/CofaxTools.log")
+ ("log" 1.0) ("adminGroupID" 4.0) ("templatePath" "toolstemplates/")
+ ("betaServer" :true) ("dataLogLocation" "/usr/local/tomcat/logs/dataLog.log")
+ ("fileTransferFolder" "/usr/local/tomcat/webapps/content/fileTransferFolder")))
+ ("servlet-name" "cofaxTools")))) ("taglib" #H((:equal-based) ("taglib-uri" "cofax.tld") ("taglib-location" "/WEB-INF/tlds/cofax.tld"))))))
Unmatched junk: ""
-AST: #("JSON Test Pattern pass1" #H((:equal-based) ("object with 1 member" #("array with 1 element"))) #H((:equal-based)) #() -42.0 :true :false :null #H((:equal-based) ("" 2.3456789012e76) ("digit" "0123456789") ("\\/\\\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" "A key can be any string") ("null" :null) ("one" 1.0) ("E" 1.23456789e34) ("special" "`1~!@#$%^&*()_+-={':[,]}|;.</>?") ("e" 1.23456789e-13) ("comment" "// /* <!-- --") ("# -- --> */" " ") ("real" -9876.54321) ("backslash" "\\\\") ("array" #()) ("url" "http://www.JSON.org/") ("zero" 0.0) ("false" :false) ("space" " ") ("slash" "/ & \\/") ("address" "50 St. James Street") ("compact" #(1.0 2.0 3.0 4.0 5.0 6.0 7.0)) ("object" #H((:equal-based))) ("quote" "\"") ("jsontext" "{\"object with 1 member\":[\"array with 1 element\"]}") ("true" :true) ("integer" 1234567890.0) ("ALPHA" "ABCDEFGHIJKLMNOPQRSTUVWYZ") ("quotes" "&#34; \" %22 0x22 034 &#x22;") ("hex" "ģ䕧覫췯ꯍ") ("0123456789" "digit") ("controls" "\b\f\n\r\t") ("alpha" "abcdefghijklmnopqrstuvwyz") (" s p a c e d " #(1.0 2.0 3.0 4.0 5.0 6.0 7.0))) 0.5 98.6 99.44 1066.0 10.0 1.0 0.1 1.0 2.0 2.0 "rosebud")
+AST: #("JSON Test Pattern pass1" #H((:equal-based) ("object with 1 member" #("array with 1 element")))
+ #H((:equal-based)) #() -42.0 :true :false :null #H((:equal-based) ("" 2.3456789012e76) ("digit" "0123456789") ("\\/\\\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" "A key can be any string")
+ ("null" :null) ("one" 1.0) ("E" 1.23456789e34) ("special" "`1~!@#$%^&*()_+-={':[,]}|;.</>?")
+ ("e" 1.23456789e-13) ("comment" "// /* <!-- --") ("# -- --> */" " ")
+ ("real" -9876.54321) ("backslash" "\\\\") ("array" #()) ("url" "http://www.JSON.org/")
+ ("zero" 0.0) ("false" :false) ("space" " ") ("slash" "/ & \\/")
+ ("address" "50 St. James Street") ("compact" #(1.0 2.0 3.0 4.0 5.0 6.0 7.0))
+ ("object" #H((:equal-based))) ("quote" "\"") ("jsontext" "{\"object with 1 member\":[\"array with 1 element\"]}")
+ ("true" :true) ("integer" 1234567890.0) ("ALPHA" "ABCDEFGHIJKLMNOPQRSTUVWYZ")
+ ("quotes" "&#34; \" %22 0x22 034 &#x22;") ("hex" "ģ䕧覫췯ꯍ") ("0123456789" "digit")
+ ("controls" "\b\f\n\r\t") ("alpha" "abcdefghijklmnopqrstuvwyz")
+ (" s p a c e d " #(1.0 2.0 3.0 4.0 5.0 6.0 7.0)))
+ 0.5 98.6 99.44 1066.0 10.0 1.0 0.1 1.0 2.0 2.0 "rosebud")
Unmatched junk: ""