diff --git a/.bzrignore b/.bzrignore old mode 100755 new mode 100644 diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg old mode 100755 new mode 100644 diff --git a/config/nimdoc.tex.cfg b/config/nimdoc.tex.cfg old mode 100755 new mode 100644 diff --git a/config/nimrod.cfg b/config/nimrod.cfg old mode 100755 new mode 100644 diff --git a/contributors.txt b/contributors.txt old mode 100755 new mode 100644 diff --git a/copying.txt b/copying.txt old mode 100755 new mode 100644 diff --git a/data/advopt.txt b/data/advopt.txt old mode 100755 new mode 100644 diff --git a/data/ast.yml b/data/ast.yml old mode 100755 new mode 100644 diff --git a/data/basicopt.txt b/data/basicopt.txt old mode 100755 new mode 100644 diff --git a/data/keywords.txt b/data/keywords.txt old mode 100755 new mode 100644 diff --git a/data/magic.yml b/data/magic.yml old mode 100755 new mode 100644 diff --git a/data/messages.yml b/data/messages.yml old mode 100755 new mode 100644 diff --git a/data/pas_keyw.yml b/data/pas_keyw.yml old mode 100755 new mode 100644 diff --git a/data/readme.txt b/data/readme.txt old mode 100755 new mode 100644 diff --git a/diff/empty.txt b/diff/empty.txt old mode 100755 new mode 100644 diff --git a/doc/abstypes.txt b/doc/abstypes.txt old mode 100755 new mode 100644 diff --git a/doc/apis.txt b/doc/apis.txt old mode 100755 new mode 100644 diff --git a/doc/astspec.txt b/doc/astspec.txt old mode 100755 new mode 100644 diff --git a/doc/docs.txt b/doc/docs.txt old mode 100755 new mode 100644 diff --git a/doc/effects.txt b/doc/effects.txt old mode 100755 new mode 100644 diff --git a/doc/endb.txt b/doc/endb.txt old mode 100755 new mode 100644 diff --git a/doc/filelist.txt b/doc/filelist.txt old mode 100755 new mode 100644 diff --git a/doc/filters.txt b/doc/filters.txt old mode 100755 new mode 100644 diff --git a/doc/gramcurl.txt b/doc/gramcurl.txt old mode 100755 new mode 100644 diff --git a/doc/grammar.txt b/doc/grammar.txt old mode 100755 new mode 100644 diff --git a/doc/intern.txt b/doc/intern.txt old mode 100755 new mode 100644 diff --git a/doc/lib.txt b/doc/lib.txt old mode 100755 new mode 100644 diff --git a/doc/manual.txt b/doc/manual.txt old mode 100755 new mode 100644 diff --git a/doc/mytest.cfg b/doc/mytest.cfg old mode 100755 new mode 100644 diff --git a/doc/nimdoc.css b/doc/nimdoc.css old mode 100755 new mode 100644 diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt old mode 100755 new mode 100644 diff --git a/doc/overview.txt b/doc/overview.txt old mode 100755 new mode 100644 diff --git a/doc/pegdocs.txt b/doc/pegdocs.txt old mode 100755 new mode 100644 diff --git a/doc/readme.txt b/doc/readme.txt old mode 100755 new mode 100644 diff --git a/doc/regexprs.txt b/doc/regexprs.txt old mode 100755 new mode 100644 diff --git a/doc/rst.txt b/doc/rst.txt old mode 100755 new mode 100644 diff --git a/doc/theindex.txt b/doc/theindex.txt old mode 100755 new mode 100644 diff --git a/doc/tut1.txt b/doc/tut1.txt old mode 100755 new mode 100644 diff --git a/doc/tut2.txt b/doc/tut2.txt old mode 100755 new mode 100644 diff --git a/examples/allany.nim b/examples/allany.nim old mode 100755 new mode 100644 diff --git a/examples/filterex.nim b/examples/filterex.nim old mode 100755 new mode 100644 diff --git a/examples/hallo.nim b/examples/hallo.nim old mode 100755 new mode 100644 diff --git a/examples/htmlrefs.nim b/examples/htmlrefs.nim old mode 100755 new mode 100644 diff --git a/examples/htmltitle.nim b/examples/htmltitle.nim old mode 100755 new mode 100644 diff --git a/examples/iupex1.nim b/examples/iupex1.nim old mode 100755 new mode 100644 diff --git a/examples/keyval.nim b/examples/keyval.nim old mode 100755 new mode 100644 diff --git a/examples/keyval2.nim b/examples/keyval2.nim old mode 100755 new mode 100644 diff --git a/examples/luaex.nim b/examples/luaex.nim old mode 100755 new mode 100644 diff --git a/examples/maximum.nim b/examples/maximum.nim old mode 100755 new mode 100644 diff --git a/examples/myfile.txt b/examples/myfile.txt old mode 100755 new mode 100644 diff --git a/examples/pythonex.nim b/examples/pythonex.nim old mode 100755 new mode 100644 diff --git a/examples/readme.txt b/examples/readme.txt old mode 100755 new mode 100644 diff --git a/examples/statcsv.nim b/examples/statcsv.nim old mode 100755 new mode 100644 diff --git a/examples/tclex.nim b/examples/tclex.nim old mode 100755 new mode 100644 diff --git a/examples/transff.nim b/examples/transff.nim old mode 100755 new mode 100644 diff --git a/gpl.html b/gpl.html old mode 100755 new mode 100644 diff --git a/ide/config.nim b/ide/config.nim old mode 100755 new mode 100644 diff --git a/ide/main.nim b/ide/main.nim old mode 100755 new mode 100644 diff --git a/ide/nimide.glade b/ide/nimide.glade old mode 100755 new mode 100644 diff --git a/ide/nimide.gladep b/ide/nimide.gladep old mode 100755 new mode 100644 diff --git a/ide/nimide.nim b/ide/nimide.nim old mode 100755 new mode 100644 diff --git a/install.txt b/install.txt old mode 100755 new mode 100644 diff --git a/koch.nim b/koch.nim old mode 100755 new mode 100644 diff --git a/lib/copying.txt b/lib/copying.txt old mode 100755 new mode 100644 diff --git a/lib/cycle.h b/lib/cycle.h old mode 100755 new mode 100644 diff --git a/lib/ecmas/dom.nim b/lib/ecmas/dom.nim old mode 100755 new mode 100644 diff --git a/lib/impure/db_mysql.nim b/lib/impure/db_mysql.nim old mode 100755 new mode 100644 diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim old mode 100755 new mode 100644 diff --git a/lib/impure/dialogs.nim b/lib/impure/dialogs.nim old mode 100755 new mode 100644 diff --git a/lib/impure/web.nim b/lib/impure/web.nim old mode 100755 new mode 100644 diff --git a/lib/impure/zipfiles.nim b/lib/impure/zipfiles.nim old mode 100755 new mode 100644 diff --git a/lib/lgpl.txt b/lib/lgpl.txt old mode 100755 new mode 100644 diff --git a/lib/newwrap/cairo/cairo.nim b/lib/newwrap/cairo/cairo.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/cairo/cairoft.nim b/lib/newwrap/cairo/cairoft.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/cairo/cairowin32.nim b/lib/newwrap/cairo/cairowin32.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/cairo/cairoxlib.nim b/lib/newwrap/cairo/cairoxlib.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/atk.nim b/lib/newwrap/gtk/atk.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/gdk2.nim b/lib/newwrap/gtk/gdk2.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/gdk2pixbuf.nim b/lib/newwrap/gtk/gdk2pixbuf.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/gdkglext.nim b/lib/newwrap/gtk/gdkglext.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/glib2.nim b/lib/newwrap/gtk/glib2.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/gtk2.nim b/lib/newwrap/gtk/gtk2.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/gtkglext.nim b/lib/newwrap/gtk/gtkglext.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/gtkhtml.nim b/lib/newwrap/gtk/gtkhtml.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/libglade2.nim b/lib/newwrap/gtk/libglade2.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/pango.nim b/lib/newwrap/gtk/pango.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/gtk/pangoutils.nim b/lib/newwrap/gtk/pangoutils.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/libcurl.nim b/lib/newwrap/libcurl.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/lua/lauxlib.nim b/lib/newwrap/lua/lauxlib.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/lua/lua.nim b/lib/newwrap/lua/lua.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/lua/lualib.nim b/lib/newwrap/lua/lualib.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/mysql.nim b/lib/newwrap/mysql.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/opengl/gl.nim b/lib/newwrap/opengl/gl.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/opengl/glext.nim b/lib/newwrap/opengl/glext.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/opengl/glu.nim b/lib/newwrap/opengl/glu.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/opengl/glut.nim b/lib/newwrap/opengl/glut.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/opengl/glx.nim b/lib/newwrap/opengl/glx.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/opengl/wingl.nim b/lib/newwrap/opengl/wingl.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/pcre/pcre.nim b/lib/newwrap/pcre/pcre.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/postgres.nim b/lib/newwrap/postgres.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl.nim b/lib/newwrap/sdl/sdl.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl_gfx.nim b/lib/newwrap/sdl/sdl_gfx.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl_image.nim b/lib/newwrap/sdl/sdl_image.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl_mixer.nim b/lib/newwrap/sdl/sdl_mixer.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim b/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl_net.nim b/lib/newwrap/sdl/sdl_net.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/sdl_ttf.nim b/lib/newwrap/sdl/sdl_ttf.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sdl/smpeg.nim b/lib/newwrap/sdl/smpeg.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/sqlite3.nim b/lib/newwrap/sqlite3.nim old mode 100755 new mode 100644 diff --git a/lib/newwrap/tcl.nim b/lib/newwrap/tcl.nim old mode 100755 new mode 100644 diff --git a/lib/nimbase.h b/lib/nimbase.h old mode 100755 new mode 100644 diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim old mode 100755 new mode 100644 diff --git a/lib/pure/browsers.nim b/lib/pure/browsers.nim old mode 100755 new mode 100644 diff --git a/lib/pure/cgi.nim b/lib/pure/cgi.nim old mode 100755 new mode 100644 diff --git a/lib/pure/complex.nim b/lib/pure/complex.nim old mode 100755 new mode 100644 diff --git a/lib/pure/dynlib.nim b/lib/pure/dynlib.nim old mode 100755 new mode 100644 diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim old mode 100755 new mode 100644 diff --git a/lib/pure/hashtabs.nim b/lib/pure/hashtabs.nim old mode 100755 new mode 100644 diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim old mode 100755 new mode 100644 index df840e15c1..5c88f211d6 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -11,7 +11,7 @@ ## It is supposed to handle the *wild* HTML the real world uses. ## ## It can be used to parse a wild HTML document and output it as valid XHTML -## document (if you are lucky): +## document (well, if you are lucky): ## ## .. code-block:: nimrod ## @@ -23,24 +23,29 @@ ## **Note:** The resulting ``PXmlNode``s already use the ``clientData`` field, ## so it cannot be used by clients of this library. -import streams, parsexml, xmltree +import strutils, streams, parsexml, xmltree, unicode, strtabs type THtmlTag* = enum ## list of all supported HTML tags; order will always be ## alphabetically tagUnknown, ## unknown HTML element tagA, ## the HTML ``a`` element + tagAbbr, ## the deprecated HTML ``abbr`` element tagAcronym, ## the HTML ``acronym`` element tagAddress, ## the HTML ``address`` element + tagApplet, ## the deprecated HTML ``applet`` element tagArea, ## the HTML ``area`` element tagB, ## the HTML ``b`` element tagBase, ## the HTML ``base`` element + tagBdo, ## the deprecated HTML ``dbo`` element + tagBasefont, ## the deprecated HTML ``basefont`` element tagBig, ## the HTML ``big`` element tagBlockquote, ## the HTML ``blockquote`` element tagBody, ## the HTML ``body`` element tagBr, ## the HTML ``br`` element tagButton, ## the HTML ``button`` element tagCaption, ## the HTML ``caption`` element + tagCenter, ## the deprecated HTML ``center`` element tagCite, ## the HTML ``cite`` element tagCode, ## the HTML ``code`` element tagCol, ## the HTML ``col`` element @@ -49,11 +54,15 @@ type tagDel, ## the HTML ``del`` element tagDfn, ## the HTML ``dfn`` element tagDiv, ## the HTML ``div`` element + tagDir, ## the deprecated HTLM ``dir`` element tagDl, ## the HTML ``dl`` element tagDt, ## the HTML ``dt`` element tagEm, ## the HTML ``em`` element tagFieldset, ## the HTML ``fieldset`` element + tagFont, ## the deprecated HTML ``font`` element tagForm, ## the HTML ``form`` element + tagFrame, ## the HTML ``frame`` element + tagFrameset, ## the deprecated HTML ``frameset`` element tagH1, ## the HTML ``h1`` element tagH2, ## the HTML ``h2`` element tagH3, ## the HTML ``h3`` element @@ -64,16 +73,21 @@ type tagHtml, ## the HTML ``html`` element tagHr, ## the HTML ``hr`` element tagI, ## the HTML ``i`` element + tagIframe, ## the deprecated HTML ``iframe`` element tagImg, ## the HTML ``img`` element tagInput, ## the HTML ``input`` element tagIns, ## the HTML ``ins`` element + tagIsindex, ## the deprecated HTML ``isindex`` element tagKbd, ## the HTML ``kbd`` element tagLabel, ## the HTML ``label`` element tagLegend, ## the HTML ``legend`` element tagLi, ## the HTML ``li`` element tagLink, ## the HTML ``link`` element tagMap, ## the HTML ``map`` element + tagMenu, ## the deprecated HTML ``menu`` element tagMeta, ## the HTML ``meta`` element + tagNobr, ## the deprecated HTML ``nobr`` element + tagNoframes, ## the deprecated HTML ``noframes`` element tagNoscript, ## the HTML ``noscript`` element tagObject, ## the HTML ``object`` element tagOl, ## the HTML ``ol`` element @@ -83,11 +97,13 @@ type tagParam, ## the HTML ``param`` element tagPre, ## the HTML ``pre`` element tagQ, ## the HTML ``q`` element + tagS, ## the deprecated HTML ``s`` element tagSamp, ## the HTML ``samp`` element tagScript, ## the HTML ``script`` element tagSelect, ## the HTML ``select`` element tagSmall, ## the HTML ``small`` element tagSpan, ## the HTML ``span`` element + tagStrike, ## the deprecated HTML ``strike`` element tagStrong, ## the HTML ``strong`` element tagStyle, ## the HTML ``style`` element tagSub, ## the HTML ``sub`` element @@ -102,21 +118,116 @@ type tagTitle, ## the HTML ``title`` element tagTr, ## the HTML ``tr`` element tagTt, ## the HTML ``tt`` element + tagU, ## the deprecated HTML ``u`` element tagUl, ## the HTML ``ul`` element tagVar ## the HTML ``var`` element -const +const tagStrs = [ - "a", "acronym", "address", "area", "b", "base", "big", "blockquote", - "body", "br", "button", "caption", "cite", "code", "col", "colgroup", - "dd", "del", "dfn", "div", "dl", "dt", "em", "fieldset", - "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "html", "hr", - "i", "img", "input", "ins", "kbd", "label", "legend", "li", "link", - "map", "meta", "noscript", "object", "ol", "optgroup", "option", - "p", "param", "pre", "q", "samp", "script", "select", "small", - "span", "strong", "style", "sub", "sup", "table", "tbody", "td", - "textarea", "tfoot", "th", "thead", "title", "tr", "tt", "ul", "var" + "a", "abbr", "acronym", "address", "applet", "area", + "b", "base", "basefont", "bdo", "big", "blockquote", "body", + "br", "button", "caption", "center", "cite", "code", + "col", "colgroup", "dd", "del", "dfn", "div", + "dir", "dl", "dt", "em", "fieldset", "font", + "form", "frame", "frameset", "h1", "h2", "h3", + "h4", "h5", "h6", "head", "html", "hr", + "i", "iframe", "img", "input", "ins", "isindex", + "kbd", "label", "legend", "li", "link", "map", + "menu", "meta", "nobr", "noframes", "noscript", "object", "ol", + "optgroup", "option", "p", "param", "pre", "q", + "s", "samp", "script", "select", "small", "span", + "strike", "strong", "style", "sub", "sup", "table", + "tbody", "td", "textarea", "tfoot", "th", "thead", + "title", "tr", "tt", "u", "ul", "var" ] + InlineTags* = {tagA, tagAbbr, tagAcronym, tagApplet, tagB, tagBasefont, + tagBdo, tagBig, tagBr, tagButton, tagCite, tagCode, tagDel, tagDfn, + tagEm, tagFont, tagI, tagImg, tagIns, tagInput, tagIframe, tagKbd, + tagLabel, tagMap, tagObject, tagQ, tagSamp, tagScript, tagSelect, + tagSmall, tagSpan, tagStrong, tagSub, tagSup, tagTextarea, tagTt, + tagVar, tagApplet, tagBasefont, tagFont, tagIframe, tagU, tagS, + tagStrike} + BlockTags* = {tagAddress, tagBlockquote, tagCenter, tagDel, tagDir, tagDiv, + tagDl, tagFieldset, tagForm, tagH1, tagH2, tagH3, tagH4, + tagH5, tagH6, tagHr, tagIns, tagIsindex, tagMenu, tagNoframes, tagNoscript, + tagOl, tagP, tagPre, tagTable, tagUl, tagCenter, tagDir, tagIsindex, + tagMenu, tagNoframes} + SingleTags* = {tagArea, tagBase, tagBasefont, + tagBr, tagCol, tagFrame, tagHr, tagImg, tagInput, tagIsindex, + tagLink, tagMeta, tagParam} # `tagP` can be both! + + Entities = [ + ("nbsp", 0x00A0), ("iexcl", 0x00A1), ("cent", 0x00A2), ("pound", 0x00A3), + ("curren", 0x00A4), ("yen", 0x00A5), ("brvbar", 0x00A6), ("sect", 0x00A7), + ("uml", 0x00A8), ("copy", 0x00A9), ("ordf", 0x00AA), ("laquo", 0x00AB), + ("not", 0x00AC), ("shy", 0x00AD), ("reg", 0x00AE), ("macr", 0x00AF), + ("deg", 0x00B0), ("plusmn", 0x00B1), ("sup2", 0x00B2), ("sup3", 0x00B3), + ("acute", 0x00B4), ("micro", 0x00B5), ("para", 0x00B6), ("middot", 0x00B7), + ("cedil", 0x00B8), ("sup1", 0x00B9), ("ordm", 0x00BA), ("raquo", 0x00BB), + ("frac14", 0x00BC), ("frac12", 0x00BD), ("frac34", 0x00BE), + ("iquest", 0x00BF), ("Agrave", 0x00C0), ("Aacute", 0x00C1), + ("Acirc", 0x00C2), ("Atilde", 0x00C3), ("Auml", 0x00C4), ("Aring", 0x00C5), + ("AElig", 0x00C6), ("Ccedil", 0x00C7), ("Egrave", 0x00C8), + ("Eacute", 0x00C9), ("Ecirc", 0x00CA), ("Euml", 0x00CB), ("Igrave", 0x00CC), + ("Iacute", 0x00CD), ("Icirc", 0x00CE), ("Iuml", 0x00CF), ("ETH", 0x00D0), + ("Ntilde", 0x00D1), ("Ograve", 0x00D2), ("Oacute", 0x00D3), + ("Ocirc", 0x00D4), ("Otilde", 0x00D5), ("Ouml", 0x00D6), ("times", 0x00D7), + ("Oslash", 0x00D8), ("Ugrave", 0x00D9), ("Uacute", 0x00DA), + ("Ucirc", 0x00DB), ("Uuml", 0x00DC), ("Yacute", 0x00DD), ("THORN", 0x00DE), + ("szlig", 0x00DF), ("agrave", 0x00E0), ("aacute", 0x00E1), + ("acirc", 0x00E2), ("atilde", 0x00E3), ("auml", 0x00E4), ("aring", 0x00E5), + ("aelig", 0x00E6), ("ccedil", 0x00E7), ("egrave", 0x00E8), + ("eacute", 0x00E9), ("ecirc", 0x00EA), ("euml", 0x00EB), ("igrave", 0x00EC), + ("iacute", 0x00ED), ("icirc", 0x00EE), ("iuml", 0x00EF), ("eth", 0x00F0), + ("ntilde", 0x00F1), ("ograve", 0x00F2), ("oacute", 0x00F3), + ("ocirc", 0x00F4), ("otilde", 0x00F5), ("ouml", 0x00F6), ("divide", 0x00F7), + ("oslash", 0x00F8), ("ugrave", 0x00F9), ("uacute", 0x00FA), + ("ucirc", 0x00FB), ("uuml", 0x00FC), ("yacute", 0x00FD), ("thorn", 0x00FE), + ("yuml", 0x00FF), ("OElig", 0x0152), ("oelig", 0x0153), ("Scaron", 0x0160), + ("scaron", 0x0161), ("Yuml", 0x0178), ("fnof", 0x0192), ("circ", 0x02C6), + ("tilde", 0x02DC), ("Alpha", 0x0391), ("Beta", 0x0392), ("Gamma", 0x0393), + ("Delta", 0x0394), ("Epsilon", 0x0395), ("Zeta", 0x0396), ("Eta", 0x0397), + ("Theta", 0x0398), ("Iota", 0x0399), ("Kappa", 0x039A), ("Lambda", 0x039B), + ("Mu", 0x039C), ("Nu", 0x039D), ("Xi", 0x039E), ("Omicron", 0x039F), + ("Pi", 0x03A0), ("Rho", 0x03A1), ("Sigma", 0x03A3), ("Tau", 0x03A4), + ("Upsilon", 0x03A5), ("Phi", 0x03A6), ("Chi", 0x03A7), ("Psi", 0x03A8), + ("Omega", 0x03A9), ("alpha", 0x03B1), ("beta", 0x03B2), ("gamma", 0x03B3), + ("delta", 0x03B4), ("epsilon", 0x03B5), ("zeta", 0x03B6), ("eta", 0x03B7), + ("theta", 0x03B8), ("iota", 0x03B9), ("kappa", 0x03BA), ("lambda", 0x03BB), + ("mu", 0x03BC), ("nu", 0x03BD), ("xi", 0x03BE), ("omicron", 0x03BF), + ("pi", 0x03C0), ("rho", 0x03C1), ("sigmaf", 0x03C2), ("sigma", 0x03C3), + ("tau", 0x03C4), ("upsilon", 0x03C5), ("phi", 0x03C6), ("chi", 0x03C7), + ("psi", 0x03C8), ("omega", 0x03C9), ("thetasym", 0x03D1), ("upsih", 0x03D2), + ("piv", 0x03D6), ("ensp", 0x2002), ("emsp", 0x2003), ("thinsp", 0x2009), + ("zwnj", 0x200C), ("zwj", 0x200D), ("lrm", 0x200E), ("rlm", 0x200F), + ("ndash", 0x2013), ("mdash", 0x2014), ("lsquo", 0x2018), ("rsquo", 0x2019), + ("sbquo", 0x201A), ("ldquo", 0x201C), ("rdquo", 0x201D), ("bdquo", 0x201E), + ("dagger", 0x2020), ("Dagger", 0x2021), ("bull", 0x2022), + ("hellip", 0x2026), ("permil", 0x2030), ("prime", 0x2032), + ("Prime", 0x2033), ("lsaquo", 0x2039), ("rsaquo", 0x203A), + ("oline", 0x203E), ("frasl", 0x2044), ("euro", 0x20AC), + ("image", 0x2111), ("weierp", 0x2118), ("real", 0x211C), + ("trade", 0x2122), ("alefsym", 0x2135), ("larr", 0x2190), + ("uarr", 0x2191), ("rarr", 0x2192), ("darr", 0x2193), + ("harr", 0x2194), ("crarr", 0x21B5), ("lArr", 0x21D0), + ("uArr", 0x21D1), ("rArr", 0x21D2), ("dArr", 0x21D3), + ("hArr", 0x21D4), ("forall", 0x2200), ("part", 0x2202), + ("exist", 0x2203), ("empty", 0x2205), ("nabla", 0x2207), + ("isin", 0x2208), ("notin", 0x2209), ("ni", 0x220B), + ("prod", 0x220F), ("sum", 0x2211), ("minus", 0x2212), + ("lowast", 0x2217), ("radic", 0x221A), ("prop", 0x221D), + ("infin", 0x221E), ("ang", 0x2220), ("and", 0x2227), + ("or", 0x2228), ("cap", 0x2229), ("cup", 0x222A), + ("int", 0x222B), ("there4", 0x2234), ("sim", 0x223C), + ("cong", 0x2245), ("asymp", 0x2248), ("ne", 0x2260), + ("equiv", 0x2261), ("le", 0x2264), ("ge", 0x2265), + ("sub", 0x2282), ("sup", 0x2283), ("nsub", 0x2284), + ("sube", 0x2286), ("supe", 0x2287), ("oplus", 0x2295), + ("otimes", 0x2297), ("perp", 0x22A5), ("sdot", 0x22C5), + ("lceil", 0x2308), ("rceil", 0x2309), ("lfloor", 0x230A), + ("rfloor", 0x230B), ("lang", 0x2329), ("rang", 0x232A), + ("loz", 0x25CA), ("spades", 0x2660), ("clubs", 0x2663), + ("hearts", 0x2665), ("diams", 0x2666)] proc binaryStrSearch(x: openarray[string], y: string): int = ## XXX put this into the library somewhere! @@ -125,110 +236,121 @@ proc binaryStrSearch(x: openarray[string], y: string): int = while a <= b: var mid = (a + b) div 2 var c = cmp(x[mid], y) - if c < 0: - a = mid + 1 - elif c > 0: - b = mid - 1 - else: - return mid + if c < 0: a = mid + 1 + elif c > 0: b = mid - 1 + else: return mid result = - 1 proc htmlTag*(n: PXmlNode): THtmlTag = - ## gets `n`'s tag as a ``THtmlTag``. Even though results are cached, this is - ## can be more expensive than comparing ``tag`` directly to a string. + ## gets `n`'s tag as a ``THtmlTag``. if n.clientData == 0: n.clientData = binaryStrSearch(tagStrs, n.tag)+1 result = THtmlTag(n.clientData) -proc parseElement(x: var TXmlParser, doc: var PDocument): PElement = - var n = doc.createElement("") +proc entityToUtf8*(entity: string): string = + ## converts an HTML entity name like ``Ü`` to its UTF-8 equivalent. + ## "" is returned if the entity name is unknown. The HTML parser + ## already converts entities to UTF-8. + for name, val in items(entities): + if name == entity: + return toUTF8(TRune(val)) + result = "" - while True: - case x.kind() - of xmlEof: +proc addNode(father, son: PXmlNode) = + if son != nil: add(father, son) + +proc parse(x: var TXmlParser, errors: var seq[string]): PXmlNode + +proc untilElementEnd(x: var TXmlParser, result: PXmlNode, + errors: var seq[string]) = + if result.htmlTag in singleTags: + if x.kind != xmlElementEnd or cmpIgnoreCase(x.elementName, result.tag) != 0: + return + while true: + case x.kind + of xmlElementEnd: + if cmpIgnoreCase(x.elementName, result.tag) == 0: + next(x) + else: + errors.add(errorMsg(x, " expected")) + # do not skip it here! + break + of xmlEof: + errors.add(errorMsg(x, " expected")) break - of xmlElementStart: - if n.tagName() != "": - n.appendChild(parseElement(x, doc)) - else: - n = doc.createElement(x.elementName) - of xmlElementOpen: - if n.tagName() != "": - n.appendChild(parseElement(x, doc)) - else: - if x.elementName.contains(':'): - #TODO: NamespaceURI - n = doc.createElementNS("nil", x.elementName) - else: - n = doc.createElement(x.elementName) - - of xmlElementEnd: - if x.elementName == n.nodeName: - # n.normalize() # Remove any whitespace etc. - return n - else: #The wrong element is ended - raise newException(EMismatchedTag, "Mismatched tag at line " & - $x.getLine() & " column " & $x.getColumn) - - of xmlCharData: - n.appendChild(parseText(x, doc)) - of xmlAttribute: - if x.attrKey.contains(':'): - #TODO: NamespaceURI - n.setAttributeNS("nil", x.attrKey, x.attrValue) - else: - n.setAttribute(x.attrKey, x.attrValue) - of xmlCData: - n.appendChild(doc.createCDATASection(x.charData())) - of xmlComment: - n.appendChild(doc.createComment(x.charData())) - of xmlPI: - n.appendChild(doc.createProcessingInstruction(x.PIName(), x.PIRest())) - - of xmlWhitespace, xmlElementClose, xmlEntity, xmlSpecial: - # Unused 'events' - else: - raise newException(EParserError, "Unexpected XML Parser event") - x.next() + result.addNode(parse(x, errors)) - raise newException(EMismatchedTag, - "Mismatched tag at line " & $x.getLine() & " column " & $x.getColumn) - - -proc parse*(x: var TXmlParser, father: PXmlNode) = - +proc parse(x: var TXmlParser, errors: var seq[string]): PXmlNode = + case x.kind + of xmlComment: + result = newComment(x.charData) + next(x) + of xmlCharData, xmlWhitespace: + result = newText(x.charData) + next(x) + of xmlPI, xmlSpecial: + # we just ignore processing instructions for now + next(x) + of xmlError: + errors.add(errorMsg(x)) + next(x) + of xmlElementStart: + result = newElement(x.elementName) + next(x) + untilElementEnd(x, result, errors) + of xmlElementEnd: + errors.add(errorMsg(x, "unexpected ending tag: " & x.elementName)) + of xmlElementOpen: + result = newElement(x.elementName) + next(x) + result.attr = newStringTable() + while true: + case x.kind + of xmlAttribute: + result.attr[x.attrKey] = x.attrValue + next(x) + of xmlElementClose: + next(x) + break + of xmlError: + errors.add(errorMsg(x)) + next(x) + break + else: + errors.add(errorMsg(x, "'>' expected")) + next(x) + break + untilElementEnd(x, result, errors) + of xmlAttribute, xmlElementClose: + errors.add(errorMsg(x, " expected")) + next(x) + of xmlCData: + result = newCData(x.charData) + next(x) + of xmlEntity: + var u = entityToUtf8(x.entityName) + if u.len != 0: result = newText(u) + next(x) + of xmlEof: nil proc parseHtml*(s: PStream, filename: string, errors: var seq[string]): PXmlNode = - ## parses the HTML from stream `s` and returns a ``PXmlNode``. Every + ## parses the XML from stream `s` and returns a ``PXmlNode``. Every ## occured parsing error is added to the `errors` sequence. var x: TXmlParser open(x, s, filename, {reportComments}) - - result = newElement("html") - while true: - x.next() - case x.kind - of xmlWhitespace: nil # just skip it - of xmlComment: - result.add(newComment(x.text)) - - while True: - x.next() - case x.kind - of xmlEof: break - of xmlElementStart, xmlElementOpen: - var el: PElement = parseElement(x, XmlDoc) - XmlDoc = dom.createDocument(el) - of xmlWhitespace, xmlElementClose, xmlEntity, xmlSpecial: - # Unused 'events' - else: - raise newException(EParserError, "Unexpected XML Parser event") + next(x) + # skip the DOCTYPE: + if x.kind == xmlSpecial: next(x) + result = parse(x, errors) + while x.kind != xmlEof: + errors.add(errorMsg(x, "EOF expected")) + result.addNode(parse(x, errors)) close(x) proc parseHtml*(s: PStream): PXmlNode = - ## parses the HTML from stream `s` and returns a ``PXmlNode``. All parsing + ## parses the XTML from stream `s` and returns a ``PXmlNode``. All parsing ## errors are ignored. var errors: seq[string] = @[] result = parseHtml(s, "unknown_html_doc", errors) @@ -236,7 +358,7 @@ proc parseHtml*(s: PStream): PXmlNode = proc loadHtml*(path: string, reportErrors = false): PXmlNode = ## Loads and parses HTML from file specified by ``path``, and returns ## a ``PXmlNode``. If `reportErrors` is true, the parsing errors are - ## ``echo``ed. + ## ``echo``ed, otherwise they are ignored. var s = newFileStream(path, fmRead) if s == nil: raise newException(EIO, "Unable to read file: " & path) @@ -245,3 +367,16 @@ proc loadHtml*(path: string, reportErrors = false): PXmlNode = if reportErrors: for msg in items(errors): echo(msg) +when true: + nil +else: + proc checkHtmlAux(n: PXmlNode, errors: var seq[string]) = + nil + + proc checkHtmlStructure*(n: PXmlNode, errors: var seq[string]) = + ## checks the HTML structure after parsing for other errors like + ## a ``

`` element within a ``

`` element. + if n == nil or n.htmlTag != tagHtml: + errors.add(" tag expected") + checkHtmlAux(n, errors) + \ No newline at end of file diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim old mode 100755 new mode 100644 index 43eab04042..0f90548739 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -60,14 +60,6 @@ type ## and ``postContent`` proc, ## when the server returns an error -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e - proc httpError(msg: string) = var e: ref EInvalidProtocol new(e) diff --git a/lib/pure/httpserver.nim b/lib/pure/httpserver.nim old mode 100755 new mode 100644 diff --git a/lib/pure/lexbase.nim b/lib/pure/lexbase.nim old mode 100755 new mode 100644 diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim old mode 100755 new mode 100644 diff --git a/lib/pure/macros.nim b/lib/pure/macros.nim old mode 100755 new mode 100644 diff --git a/lib/pure/math.nim b/lib/pure/math.nim old mode 100755 new mode 100644 diff --git a/lib/pure/md5.nim b/lib/pure/md5.nim old mode 100755 new mode 100644 diff --git a/lib/pure/os.nim b/lib/pure/os.nim old mode 100755 new mode 100644 index 1879fb5db8..ef526993ae --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -26,15 +26,6 @@ else: include "system/ansi_c" -# copied from excpt.nim, because I don't want to make this template public -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e - const doslike = defined(windows) or defined(OS2) or defined(DOS) # DOS-like filesystem diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim old mode 100755 new mode 100644 diff --git a/lib/pure/parsecfg.nim b/lib/pure/parsecfg.nim old mode 100755 new mode 100644 diff --git a/lib/pure/parsecsv.nim b/lib/pure/parsecsv.nim old mode 100755 new mode 100644 diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim old mode 100755 new mode 100644 diff --git a/lib/pure/parsesql.nim b/lib/pure/parsesql.nim old mode 100755 new mode 100644 diff --git a/lib/pure/parseurl.nim b/lib/pure/parseurl.nim old mode 100755 new mode 100644 diff --git a/lib/pure/parseutils.nim b/lib/pure/parseutils.nim old mode 100755 new mode 100644 index 04d2a7973b..0f107793c6 --- a/lib/pure/parseutils.nim +++ b/lib/pure/parseutils.nim @@ -14,15 +14,6 @@ {.push debugger:off .} # the user does not want to trace a part # of the standard library! -# copied from excpt.nim, because I don't want to make this template public -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e - const Whitespace = {' ', '\t', '\v', '\r', '\l', '\f'} IdentChars = {'a'..'z', 'A'..'Z', '0'..'9', '_'} diff --git a/lib/pure/parsexml.nim b/lib/pure/parsexml.nim old mode 100755 new mode 100644 diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim old mode 100755 new mode 100644 diff --git a/lib/pure/re.nim b/lib/pure/re.nim old mode 100755 new mode 100644 diff --git a/lib/pure/regexprs.nim b/lib/pure/regexprs.nim old mode 100755 new mode 100644 diff --git a/lib/pure/ropes.nim b/lib/pure/ropes.nim old mode 100755 new mode 100644 index aa793b4f37..df85baf923 --- a/lib/pure/ropes.nim +++ b/lib/pure/ropes.nim @@ -21,15 +21,6 @@ {.push debugger:off .} # the user does not want to trace a part # of the standard library! -# copied from excpt.nim, because I don't want to make this template public -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e - const countCacheMisses = false diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim old mode 100755 new mode 100644 diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim old mode 100755 new mode 100644 diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim old mode 100755 new mode 100644 diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim old mode 100755 new mode 100644 index fe70130e5e..2fd2aaeef3 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -17,16 +17,6 @@ import parseutils {.push debugger:off .} # the user does not want to trace a part # of the standard library! -# copied from excpt.nim, because I don't want to make this template public -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e - - type TCharSet* = set[char] # for compatibility with Nim diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim old mode 100755 new mode 100644 diff --git a/lib/pure/times.nim b/lib/pure/times.nim old mode 100755 new mode 100644 diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim old mode 100755 new mode 100644 diff --git a/lib/pure/unidecode/gen.py b/lib/pure/unidecode/gen.py old mode 100755 new mode 100644 diff --git a/lib/pure/unidecode/unidecode.dat b/lib/pure/unidecode/unidecode.dat old mode 100755 new mode 100644 diff --git a/lib/pure/unidecode/unidecode.nim b/lib/pure/unidecode/unidecode.nim old mode 100755 new mode 100644 diff --git a/lib/pure/variants.nim b/lib/pure/variants.nim old mode 100755 new mode 100644 diff --git a/lib/pure/xmldom.nim b/lib/pure/xmldom.nim old mode 100755 new mode 100644 index 4e9d721d7c..76c666de0f --- a/lib/pure/xmldom.nim +++ b/lib/pure/xmldom.nim @@ -34,14 +34,6 @@ type ESyntaxErr* = object of EDOMException ## If an invalid or illegal string is specified. EWrongDocumentErr* = object of EDOMException ## If a node is used in a different document than the one that created it (that doesn't support it) -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e - const ElementNode* = 1 AttributeNode* = 2 diff --git a/lib/pure/xmldomparser.nim b/lib/pure/xmldomparser.nim old mode 100755 new mode 100644 index 9df60cab83..b73baf1ffe --- a/lib/pure/xmldomparser.nim +++ b/lib/pure/xmldomparser.nim @@ -17,14 +17,6 @@ type #Parsing errors EMismatchedTag* = object of E_Base ## Raised when a tag is not properly closed EParserError* = object of E_Base ## Raised when an unexpected XML Parser event occurs - -template newException(exceptn, message: expr): expr = - block: # open a new scope - var - e: ref exceptn - new(e) - e.msg = message - e proc parseText(x: var TXmlParser, doc: var PDocument): PText = result = doc.createTextNode(x.charData()) diff --git a/lib/pure/xmlgen.nim b/lib/pure/xmlgen.nim old mode 100755 new mode 100644 diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim old mode 100755 new mode 100644 index 005969fc4b..2b09778740 --- a/lib/pure/xmltree.nim +++ b/lib/pure/xmltree.nim @@ -63,7 +63,7 @@ proc newCData*(cdata: string): PXmlNode = proc newEntity*(entity: string): PXmlNode = ## creates a new ``PXmlNode`` of kind ``xnEntity`` with the text `entity`. result = newXmlNode(xnCData) - result.fText = cdata + result.fText = entity proc text*(n: PXmlNode): string {.inline.} = ## gets the associated text with the node `n`. `n` can be a CDATA, Text, diff --git a/lib/pure/xmltreeparser.nim b/lib/pure/xmltreeparser.nim old mode 100755 new mode 100644 index b7a9ba54a2..bf2c055709 --- a/lib/pure/xmltreeparser.nim +++ b/lib/pure/xmltreeparser.nim @@ -9,7 +9,7 @@ ## This module parses an XML document and creates its XML tree representation. -import streams, parsexml, strtabs, xmltree, hxmlcommon +import streams, parsexml, strtabs, xmltree type EInvalidXml* = object of E_Base ## exception that is raised for invalid XML @@ -25,13 +25,30 @@ proc raiseInvalidXml(errors: seq[string]) = proc addNode(father, son: PXmlNode) = if son != nil: add(father, son) -proc parse*(x: var TXmlParser, errors: var seq[string]): PXmlNode = +proc untilElementEnd(x: var TXmlParser, result: PXmlNode, + errors: var seq[string]) = + while true: + case x.kind + of xmlElementEnd: + if x.elementName == result.tag: + next(x) + else: + errors.add(errorMsg(x, " expected")) + # do not skip it here! + break + of xmlEof: + errors.add(errorMsg(x, " expected")) + break + else: + result.addNode(parse(x, errors)) + +proc parse(x: var TXmlParser, errors: var seq[string]): PXmlNode = case x.kind of xmlComment: - result = newComment(x.text) + result = newComment(x.charData) next(x) of xmlCharData, xmlWhitespace: - result = newText(x.text) + result = newText(x.charData) next(x) of xmlPI, xmlSpecial: # we just ignore processing instructions for now @@ -42,23 +59,10 @@ proc parse*(x: var TXmlParser, errors: var seq[string]): PXmlNode = of xmlElementStart: ## ```` result = newElement(x.elementName) next(x) - while true: - case x.kind - of xmlElementEnd: - if x.elementName == result.tag: - next(x) - else: - errors.add(errorMsg(x, " expected" % result.tag)) - # do not skip it here! - break - of xmlEof: - errors.add(errorMsg(x, " expected" % result.tag)) - break - else: - result.addNode(parse(x, errors)) - of xmlElementEnd: ## ```` + untilElementEnd(x, result, errors) + of xmlElementEnd: errors.add(errorMsg(x, "unexpected ending tag: " & x.elementName)) - of xmlElementOpen: ## ``' expected" % result.tag)) + errors.add(errorMsg(x, "'>' expected")) next(x) break - + untilElementEnd(x, result, errors) of xmlAttribute, xmlElementClose: - errors.add(errorMsg(x, " expected") + errors.add(errorMsg(x, " expected")) next(x) of xmlCData: result = newCData(x.charData) @@ -107,7 +111,7 @@ proc parseXml*(s: PStream, filename: string, of xmlError: errors.add(errorMsg(x)) else: - errors.add(errorMsg(x, " expected") + errors.add(errorMsg(x, " expected")) break close(x) diff --git a/lib/system.nim b/lib/system.nim old mode 100755 new mode 100644 diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim old mode 100755 new mode 100644 diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim old mode 100755 new mode 100644 diff --git a/lib/system/arithm.nim b/lib/system/arithm.nim old mode 100755 new mode 100644 diff --git a/lib/system/assign.nim b/lib/system/assign.nim old mode 100755 new mode 100644 diff --git a/lib/system/cellsets.nim b/lib/system/cellsets.nim old mode 100755 new mode 100644 diff --git a/lib/system/cntbits.nim b/lib/system/cntbits.nim old mode 100755 new mode 100644 diff --git a/lib/system/debugger.nim b/lib/system/debugger.nim old mode 100755 new mode 100644 diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim old mode 100755 new mode 100644 diff --git a/lib/system/ecmasys.nim b/lib/system/ecmasys.nim old mode 100755 new mode 100644 diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim old mode 100755 new mode 100644 diff --git a/lib/system/gc.nim b/lib/system/gc.nim old mode 100755 new mode 100644 diff --git a/lib/system/hti.nim b/lib/system/hti.nim old mode 100755 new mode 100644 diff --git a/lib/system/mm.nim b/lib/system/mm.nim old mode 100755 new mode 100644 diff --git a/lib/system/profiler.nim b/lib/system/profiler.nim old mode 100755 new mode 100644 diff --git a/lib/system/repr.nim b/lib/system/repr.nim old mode 100755 new mode 100644 diff --git a/lib/system/sets.nim b/lib/system/sets.nim old mode 100755 new mode 100644 diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim old mode 100755 new mode 100644 diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-1.txt b/lib/ucmaps/8859-1.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-10.txt b/lib/ucmaps/8859-10.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-13.txt b/lib/ucmaps/8859-13.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-14.txt b/lib/ucmaps/8859-14.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-15.txt b/lib/ucmaps/8859-15.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-2.txt b/lib/ucmaps/8859-2.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-3.txt b/lib/ucmaps/8859-3.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-4.txt b/lib/ucmaps/8859-4.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-5.txt b/lib/ucmaps/8859-5.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-6.txt b/lib/ucmaps/8859-6.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-7.txt b/lib/ucmaps/8859-7.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-8.txt b/lib/ucmaps/8859-8.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/8859-9.txt b/lib/ucmaps/8859-9.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1250.txt b/lib/ucmaps/cp1250.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1251.txt b/lib/ucmaps/cp1251.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1252.txt b/lib/ucmaps/cp1252.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1253.txt b/lib/ucmaps/cp1253.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1254.txt b/lib/ucmaps/cp1254.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1255.txt b/lib/ucmaps/cp1255.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1256.txt b/lib/ucmaps/cp1256.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1257.txt b/lib/ucmaps/cp1257.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp1258.txt b/lib/ucmaps/cp1258.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp437.txt b/lib/ucmaps/cp437.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp737.txt b/lib/ucmaps/cp737.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp775.txt b/lib/ucmaps/cp775.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp850.txt b/lib/ucmaps/cp850.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp852.txt b/lib/ucmaps/cp852.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp855.txt b/lib/ucmaps/cp855.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp856.txt b/lib/ucmaps/cp856.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp857.txt b/lib/ucmaps/cp857.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp860.txt b/lib/ucmaps/cp860.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp861.txt b/lib/ucmaps/cp861.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp862.txt b/lib/ucmaps/cp862.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp863.txt b/lib/ucmaps/cp863.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp864.txt b/lib/ucmaps/cp864.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp865.txt b/lib/ucmaps/cp865.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp866.txt b/lib/ucmaps/cp866.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp869.txt b/lib/ucmaps/cp869.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp874.txt b/lib/ucmaps/cp874.txt old mode 100755 new mode 100644 diff --git a/lib/ucmaps/cp932.txt b/lib/ucmaps/cp932.txt old mode 100755 new mode 100644 diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim old mode 100755 new mode 100644 index 07d0cb5385..c7dd5b1be8 --- a/lib/windows/mmsystem.nim +++ b/lib/windows/mmsystem.nim @@ -21,6 +21,8 @@ # LCC-win32 (c) Jacob Navia #******************************* +{.deadCodeElim: on.} + import windows diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim old mode 100755 new mode 100644 index 615488ac1b..527e3a9e23 --- a/lib/windows/nb30.nim +++ b/lib/windows/nb30.nim @@ -10,6 +10,8 @@ # This module contains the definitions for portable NetBIOS 3.0 support. +{.deadCodeElim: on.} + import # Data structure templates Windows diff --git a/lib/windows/ole2.nim b/lib/windows/ole2.nim old mode 100755 new mode 100644 diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim old mode 100755 new mode 100644 index a4a976c609..c6d2d69a1a --- a/lib/windows/shellapi.nim +++ b/lib/windows/shellapi.nim @@ -7,6 +7,8 @@ # distribution, for details about the copyright. # +{.deadCodeElim: on.} + # leave out unused functions so the unit can be used on win2000 as well #+------------------------------------------------------------------------- diff --git a/lib/windows/shfolder.nim b/lib/windows/shfolder.nim old mode 100755 new mode 100644 index 210f6441f9..253b1c77ab --- a/lib/windows/shfolder.nim +++ b/lib/windows/shfolder.nim @@ -21,6 +21,8 @@ # systems. # --------------------------------------------------------------------- +{.deadCodeElim: on.} + import windows diff --git a/lib/windows/windows.nim b/lib/windows/windows.nim old mode 100755 new mode 100644 diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/cairo/cairo.nim b/lib/wrappers/cairo/cairo.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/cairo/cairoft.nim b/lib/wrappers/cairo/cairoft.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/cairo/cairowin32.nim b/lib/wrappers/cairo/cairowin32.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/cairo/cairoxlib.nim b/lib/wrappers/cairo/cairoxlib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/atk.nim b/lib/wrappers/gtk/atk.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/gdk2.nim b/lib/wrappers/gtk/gdk2.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/gdk2pixbuf.nim b/lib/wrappers/gtk/gdk2pixbuf.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/gdkglext.nim b/lib/wrappers/gtk/gdkglext.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/glib2.nim b/lib/wrappers/gtk/glib2.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/gtk2.nim b/lib/wrappers/gtk/gtk2.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/gtkglext.nim b/lib/wrappers/gtk/gtkglext.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/gtkhtml.nim b/lib/wrappers/gtk/gtkhtml.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/libglade2.nim b/lib/wrappers/gtk/libglade2.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/pango.nim b/lib/wrappers/gtk/pango.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/gtk/pangoutils.nim b/lib/wrappers/gtk/pangoutils.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/iup.nim b/lib/wrappers/iup.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/libcurl.nim b/lib/wrappers/libcurl.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/lua/lauxlib.nim b/lib/wrappers/lua/lauxlib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/lua/lua.nim b/lib/wrappers/lua/lua.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/lua/lualib.nim b/lib/wrappers/lua/lualib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/mysql.nim b/lib/wrappers/mysql.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/odbcsql.nim b/lib/wrappers/odbcsql.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/opengl/gl.nim b/lib/wrappers/opengl/gl.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/opengl/glext.nim b/lib/wrappers/opengl/glext.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/opengl/glu.nim b/lib/wrappers/opengl/glu.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/opengl/glut.nim b/lib/wrappers/opengl/glut.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/opengl/glx.nim b/lib/wrappers/opengl/glx.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/opengl/wingl.nim b/lib/wrappers/opengl/wingl.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/pcre/pcre.nim b/lib/wrappers/pcre/pcre.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/pcre/pcre_all.c b/lib/wrappers/pcre/pcre_all.c old mode 100755 new mode 100644 diff --git a/lib/wrappers/postgres.nim b/lib/wrappers/postgres.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/python.nim b/lib/wrappers/python.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl.nim b/lib/wrappers/sdl/sdl.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl_gfx.nim b/lib/wrappers/sdl/sdl_gfx.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl_image.nim b/lib/wrappers/sdl/sdl_image.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl_mixer.nim b/lib/wrappers/sdl/sdl_mixer.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl_mixer_nosmpeg.nim b/lib/wrappers/sdl/sdl_mixer_nosmpeg.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl_net.nim b/lib/wrappers/sdl/sdl_net.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdl_ttf.nim b/lib/wrappers/sdl/sdl_ttf.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/sdlutils.pas b/lib/wrappers/sdl/sdlutils.pas old mode 100755 new mode 100644 diff --git a/lib/wrappers/sdl/smpeg.nim b/lib/wrappers/sdl/smpeg.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/sqlite3.nim b/lib/wrappers/sqlite3.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/tcl.nim b/lib/wrappers/tcl.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/tre/config.h b/lib/wrappers/tre/config.h old mode 100755 new mode 100644 diff --git a/lib/wrappers/tre/tre_all.c b/lib/wrappers/tre/tre_all.c old mode 100755 new mode 100644 diff --git a/lib/wrappers/tre/version.txt b/lib/wrappers/tre/version.txt old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/cursorfont.nim b/lib/wrappers/x11/cursorfont.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/keysym.nim b/lib/wrappers/x11/keysym.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/x.nim b/lib/wrappers/x11/x.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xatom.nim b/lib/wrappers/x11/xatom.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xcms.nim b/lib/wrappers/x11/xcms.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xf86dga.nim b/lib/wrappers/x11/xf86dga.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xf86vmode.nim b/lib/wrappers/x11/xf86vmode.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xi.nim b/lib/wrappers/x11/xi.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xinerama.nim b/lib/wrappers/x11/xinerama.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xkb.nim b/lib/wrappers/x11/xkb.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xkblib.nim b/lib/wrappers/x11/xkblib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xlib.nim b/lib/wrappers/x11/xlib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xrandr.nim b/lib/wrappers/x11/xrandr.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xrender.nim b/lib/wrappers/x11/xrender.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xresource.nim b/lib/wrappers/x11/xresource.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xshm.nim b/lib/wrappers/x11/xshm.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xutil.nim b/lib/wrappers/x11/xutil.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xv.nim b/lib/wrappers/x11/xv.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/x11/xvlib.nim b/lib/wrappers/x11/xvlib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/zip/libzip.nim b/lib/wrappers/zip/libzip.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/zip/libzip_all.c b/lib/wrappers/zip/libzip_all.c old mode 100755 new mode 100644 diff --git a/lib/wrappers/zip/zlib.nim b/lib/wrappers/zip/zlib.nim old mode 100755 new mode 100644 diff --git a/lib/wrappers/zip/zzip.nim b/lib/wrappers/zip/zzip.nim old mode 100755 new mode 100644 diff --git a/llvm/llvm.h b/llvm/llvm.h old mode 100755 new mode 100644 diff --git a/llvm/llvm.nim b/llvm/llvm.nim old mode 100755 new mode 100644 diff --git a/llvm/llvm.pas b/llvm/llvm.pas old mode 100755 new mode 100644 diff --git a/llvm/llvm_orig.nim b/llvm/llvm_orig.nim old mode 100755 new mode 100644 diff --git a/nim/ast.pas b/nim/ast.pas old mode 100755 new mode 100644 index 277d7d0617..0079d755cf --- a/nim/ast.pas +++ b/nim/ast.pas @@ -475,7 +475,8 @@ type end; const - OverloadableSyms = {@set}[skProc, skMethod, skIterator, skConverter]; + OverloadableSyms = {@set}[skProc, skMethod, skIterator, skConverter, + skModule]; const // "MagicToStr" array: MagicToStr: array [TMagic] of string = ( diff --git a/nim/astalgo.pas b/nim/astalgo.pas old mode 100755 new mode 100644 diff --git a/nim/bitsets.pas b/nim/bitsets.pas old mode 100755 new mode 100644 diff --git a/nim/ccgexprs.pas b/nim/ccgexprs.pas old mode 100755 new mode 100644 diff --git a/nim/ccgstmts.pas b/nim/ccgstmts.pas old mode 100755 new mode 100644 diff --git a/nim/ccgtypes.pas b/nim/ccgtypes.pas old mode 100755 new mode 100644 diff --git a/nim/ccgutils.pas b/nim/ccgutils.pas old mode 100755 new mode 100644 diff --git a/nim/cgen.pas b/nim/cgen.pas old mode 100755 new mode 100644 diff --git a/nim/cgmeth.pas b/nim/cgmeth.pas old mode 100755 new mode 100644 diff --git a/nim/charsets.pas b/nim/charsets.pas old mode 100755 new mode 100644 diff --git a/nim/commands.pas b/nim/commands.pas old mode 100755 new mode 100644 diff --git a/nim/condsyms.pas b/nim/condsyms.pas old mode 100755 new mode 100644 diff --git a/nim/config.inc b/nim/config.inc old mode 100755 new mode 100644 diff --git a/nim/crc.pas b/nim/crc.pas old mode 100755 new mode 100644 diff --git a/nim/depends.pas b/nim/depends.pas old mode 100755 new mode 100644 diff --git a/nim/docgen.pas b/nim/docgen.pas old mode 100755 new mode 100644 diff --git a/nim/ecmasgen.pas b/nim/ecmasgen.pas old mode 100755 new mode 100644 diff --git a/nim/evals.pas b/nim/evals.pas old mode 100755 new mode 100644 diff --git a/nim/extccomp.pas b/nim/extccomp.pas old mode 100755 new mode 100644 diff --git a/nim/filters.pas b/nim/filters.pas old mode 100755 new mode 100644 diff --git a/nim/hashtest.pas b/nim/hashtest.pas old mode 100755 new mode 100644 diff --git a/nim/highlite.pas b/nim/highlite.pas old mode 100755 new mode 100644 diff --git a/nim/idents.pas b/nim/idents.pas old mode 100755 new mode 100644 diff --git a/nim/importer.pas b/nim/importer.pas old mode 100755 new mode 100644 diff --git a/nim/interact.pas b/nim/interact.pas old mode 100755 new mode 100644 diff --git a/nim/lexbase.pas b/nim/lexbase.pas old mode 100755 new mode 100644 diff --git a/nim/lists.pas b/nim/lists.pas old mode 100755 new mode 100644 diff --git a/nim/llstream.pas b/nim/llstream.pas old mode 100755 new mode 100644 diff --git a/nim/llvmdata.pas b/nim/llvmdata.pas old mode 100755 new mode 100644 diff --git a/nim/llvmdyn.pas b/nim/llvmdyn.pas old mode 100755 new mode 100644 diff --git a/nim/llvmstat.pas b/nim/llvmstat.pas old mode 100755 new mode 100644 diff --git a/nim/lookups.pas b/nim/lookups.pas old mode 100755 new mode 100644 diff --git a/nim/magicsys.pas b/nim/magicsys.pas old mode 100755 new mode 100644 diff --git a/nim/main.pas b/nim/main.pas old mode 100755 new mode 100644 diff --git a/nim/msgs.pas b/nim/msgs.pas old mode 100755 new mode 100644 diff --git a/nim/nhashes.pas b/nim/nhashes.pas old mode 100755 new mode 100644 diff --git a/nim/nimconf.pas b/nim/nimconf.pas old mode 100755 new mode 100644 diff --git a/nim/nimrod.pas b/nim/nimrod.pas old mode 100755 new mode 100644 diff --git a/nim/nimsets.pas b/nim/nimsets.pas old mode 100755 new mode 100644 diff --git a/nim/nmath.pas b/nim/nmath.pas old mode 100755 new mode 100644 diff --git a/nim/nos.pas b/nim/nos.pas old mode 100755 new mode 100644 diff --git a/nim/nstrtabs.pas b/nim/nstrtabs.pas old mode 100755 new mode 100644 diff --git a/nim/nsystem.pas b/nim/nsystem.pas old mode 100755 new mode 100644 diff --git a/nim/ntime.pas b/nim/ntime.pas old mode 100755 new mode 100644 diff --git a/nim/nversion.pas b/nim/nversion.pas old mode 100755 new mode 100644 diff --git a/nim/options.pas b/nim/options.pas old mode 100755 new mode 100644 diff --git a/nim/osproc.pas b/nim/osproc.pas old mode 100755 new mode 100644 diff --git a/nim/parsecfg.pas b/nim/parsecfg.pas old mode 100755 new mode 100644 diff --git a/nim/parseopt.pas b/nim/parseopt.pas old mode 100755 new mode 100644 diff --git a/nim/paslex.pas b/nim/paslex.pas old mode 100755 new mode 100644 diff --git a/nim/pasparse.pas b/nim/pasparse.pas old mode 100755 new mode 100644 diff --git a/nim/passaux.pas b/nim/passaux.pas old mode 100755 new mode 100644 diff --git a/nim/passes.pas b/nim/passes.pas old mode 100755 new mode 100644 diff --git a/nim/pbraces.pas b/nim/pbraces.pas old mode 100755 new mode 100644 diff --git a/nim/pendx.pas b/nim/pendx.pas old mode 100755 new mode 100644 diff --git a/nim/platform.pas b/nim/platform.pas old mode 100755 new mode 100644 diff --git a/nim/pnimsyn.pas b/nim/pnimsyn.pas old mode 100755 new mode 100644 diff --git a/nim/pragmas.pas b/nim/pragmas.pas old mode 100755 new mode 100644 diff --git a/nim/procfind.pas b/nim/procfind.pas old mode 100755 new mode 100644 diff --git a/nim/ptmplsyn.pas b/nim/ptmplsyn.pas old mode 100755 new mode 100644 diff --git a/nim/readme.txt b/nim/readme.txt old mode 100755 new mode 100644 diff --git a/nim/rnimsyn.pas b/nim/rnimsyn.pas old mode 100755 new mode 100644 diff --git a/nim/rodread.pas b/nim/rodread.pas old mode 100755 new mode 100644 diff --git a/nim/rodwrite.pas b/nim/rodwrite.pas old mode 100755 new mode 100644 diff --git a/nim/ropes.pas b/nim/ropes.pas old mode 100755 new mode 100644 diff --git a/nim/rst.pas b/nim/rst.pas old mode 100755 new mode 100644 diff --git a/nim/scanner.pas b/nim/scanner.pas old mode 100755 new mode 100644 diff --git a/nim/sem.pas b/nim/sem.pas old mode 100755 new mode 100644 diff --git a/nim/semdata.pas b/nim/semdata.pas old mode 100755 new mode 100644 diff --git a/nim/semexprs.pas b/nim/semexprs.pas old mode 100755 new mode 100644 diff --git a/nim/semfold.pas b/nim/semfold.pas old mode 100755 new mode 100644 diff --git a/nim/semgnrc.pas b/nim/semgnrc.pas old mode 100755 new mode 100644 diff --git a/nim/seminst.pas b/nim/seminst.pas old mode 100755 new mode 100644 diff --git a/nim/semstmts.pas b/nim/semstmts.pas old mode 100755 new mode 100644 diff --git a/nim/semtempl.pas b/nim/semtempl.pas old mode 100755 new mode 100644 diff --git a/nim/semtypes.pas b/nim/semtypes.pas old mode 100755 new mode 100644 diff --git a/nim/sigmatch.pas b/nim/sigmatch.pas old mode 100755 new mode 100644 diff --git a/nim/strutils.pas b/nim/strutils.pas old mode 100755 new mode 100644 diff --git a/nim/syntaxes.pas b/nim/syntaxes.pas old mode 100755 new mode 100644 diff --git a/nim/tigen.pas b/nim/tigen.pas old mode 100755 new mode 100644 diff --git a/nim/transf.pas b/nim/transf.pas old mode 100755 new mode 100644 diff --git a/nim/transtmp.pas b/nim/transtmp.pas old mode 100755 new mode 100644 diff --git a/nim/trees.pas b/nim/trees.pas old mode 100755 new mode 100644 diff --git a/nim/treetab.pas b/nim/treetab.pas old mode 100755 new mode 100644 diff --git a/nim/types.pas b/nim/types.pas old mode 100755 new mode 100644 diff --git a/nim/wordrecg.pas b/nim/wordrecg.pas old mode 100755 new mode 100644 diff --git a/nimlib/copying.txt b/nimlib/copying.txt old mode 100755 new mode 100644 diff --git a/nimlib/lgpl.txt b/nimlib/lgpl.txt old mode 100755 new mode 100644 diff --git a/nimlib/nimbase.h b/nimlib/nimbase.h old mode 100755 new mode 100644 diff --git a/nimlib/posix/posix.nim b/nimlib/posix/posix.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/cgi.nim b/nimlib/pure/cgi.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/complex.nim b/nimlib/pure/complex.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/dynlib.nim b/nimlib/pure/dynlib.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/hashes.nim b/nimlib/pure/hashes.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/hashtabs.nim b/nimlib/pure/hashtabs.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/lexbase.nim b/nimlib/pure/lexbase.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/logging.nim b/nimlib/pure/logging.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/macros.nim b/nimlib/pure/macros.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/math.nim b/nimlib/pure/math.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/md5.nim b/nimlib/pure/md5.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/os.nim b/nimlib/pure/os.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/osproc.nim b/nimlib/pure/osproc.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/parsecfg.nim b/nimlib/pure/parsecfg.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/parsecsv.nim b/nimlib/pure/parsecsv.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/parseopt.nim b/nimlib/pure/parseopt.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/parsesql.nim b/nimlib/pure/parsesql.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/parsexml.nim b/nimlib/pure/parsexml.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/pegs.nim b/nimlib/pure/pegs.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/re.nim b/nimlib/pure/re.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/regexprs.nim b/nimlib/pure/regexprs.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/streams.nim b/nimlib/pure/streams.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/strtabs.nim b/nimlib/pure/strtabs.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/strutils.nim b/nimlib/pure/strutils.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/terminal.nim b/nimlib/pure/terminal.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/times.nim b/nimlib/pure/times.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/unicode.nim b/nimlib/pure/unicode.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/variants.nim b/nimlib/pure/variants.nim old mode 100755 new mode 100644 diff --git a/nimlib/pure/xmlgen.nim b/nimlib/pure/xmlgen.nim old mode 100755 new mode 100644 diff --git a/nimlib/readme.txt b/nimlib/readme.txt old mode 100755 new mode 100644 diff --git a/nimlib/system.nim b/nimlib/system.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/alloc.nim b/nimlib/system/alloc.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/ansi_c.nim b/nimlib/system/ansi_c.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/arithm.nim b/nimlib/system/arithm.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/assign.nim b/nimlib/system/assign.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/cellsets.nim b/nimlib/system/cellsets.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/cntbits.nim b/nimlib/system/cntbits.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/debugger.nim b/nimlib/system/debugger.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/dyncalls.nim b/nimlib/system/dyncalls.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/ecmasys.nim b/nimlib/system/ecmasys.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/excpt.nim b/nimlib/system/excpt.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/gc.nim b/nimlib/system/gc.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/hti.nim b/nimlib/system/hti.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/mm.nim b/nimlib/system/mm.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/profiler.nim b/nimlib/system/profiler.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/repr.nim b/nimlib/system/repr.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/sets.nim b/nimlib/system/sets.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/sysio.nim b/nimlib/system/sysio.nim old mode 100755 new mode 100644 diff --git a/nimlib/system/sysstr.nim b/nimlib/system/sysstr.nim old mode 100755 new mode 100644 diff --git a/nimlib/windows/winlean.nim b/nimlib/windows/winlean.nim old mode 100755 new mode 100644 diff --git a/noprefix.nim b/noprefix.nim old mode 100755 new mode 100644 diff --git a/obj/empty.txt b/obj/empty.txt old mode 100755 new mode 100644 diff --git a/readme.txt b/readme.txt old mode 100755 new mode 100644 diff --git a/rod/ast.nim b/rod/ast.nim old mode 100755 new mode 100644 index 0be562980e..fde238eaa9 --- a/rod/ast.nim +++ b/rod/ast.nim @@ -502,9 +502,12 @@ type counter*: int data*: TObjectSeq +# BUGFIX: a module is overloadable so that a proc can have the +# same name as an imported module. This is necessary because of +# the poor naming choices in the standard library. const - OverloadableSyms* = {skProc, skMethod, skIterator, skConverter} + OverloadableSyms* = {skProc, skMethod, skIterator, skConverter, skModule} GenericTypes*: TTypeKinds = {tyGenericInvokation, tyGenericBody, tyGenericParam} diff --git a/rod/astalgo.nim b/rod/astalgo.nim old mode 100755 new mode 100644 diff --git a/rod/bitsets.nim b/rod/bitsets.nim old mode 100755 new mode 100644 diff --git a/rod/ccgexprs.nim b/rod/ccgexprs.nim old mode 100755 new mode 100644 diff --git a/rod/ccgstmts.nim b/rod/ccgstmts.nim old mode 100755 new mode 100644 diff --git a/rod/ccgtypes.nim b/rod/ccgtypes.nim old mode 100755 new mode 100644 diff --git a/rod/ccgutils.nim b/rod/ccgutils.nim old mode 100755 new mode 100644 diff --git a/rod/cgen.nim b/rod/cgen.nim old mode 100755 new mode 100644 diff --git a/rod/cgmeth.nim b/rod/cgmeth.nim old mode 100755 new mode 100644 diff --git a/rod/charsets.nim b/rod/charsets.nim old mode 100755 new mode 100644 diff --git a/rod/commands.nim b/rod/commands.nim old mode 100755 new mode 100644 diff --git a/rod/condsyms.nim b/rod/condsyms.nim old mode 100755 new mode 100644 diff --git a/rod/crc.nim b/rod/crc.nim old mode 100755 new mode 100644 diff --git a/rod/depends.nim b/rod/depends.nim old mode 100755 new mode 100644 diff --git a/rod/docgen.nim b/rod/docgen.nim old mode 100755 new mode 100644 diff --git a/rod/ecmasgen.nim b/rod/ecmasgen.nim old mode 100755 new mode 100644 diff --git a/rod/evals.nim b/rod/evals.nim old mode 100755 new mode 100644 diff --git a/rod/expandimportc.nim b/rod/expandimportc.nim old mode 100755 new mode 100644 diff --git a/rod/extccomp.nim b/rod/extccomp.nim old mode 100755 new mode 100644 diff --git a/rod/filters.nim b/rod/filters.nim old mode 100755 new mode 100644 diff --git a/rod/hashtest.nim b/rod/hashtest.nim old mode 100755 new mode 100644 diff --git a/rod/highlite.nim b/rod/highlite.nim old mode 100755 new mode 100644 diff --git a/rod/idents.nim b/rod/idents.nim old mode 100755 new mode 100644 diff --git a/rod/importer.nim b/rod/importer.nim old mode 100755 new mode 100644 diff --git a/rod/interact.nim b/rod/interact.nim old mode 100755 new mode 100644 diff --git a/rod/lexbase.nim b/rod/lexbase.nim old mode 100755 new mode 100644 diff --git a/rod/lists.nim b/rod/lists.nim old mode 100755 new mode 100644 diff --git a/rod/llstream.nim b/rod/llstream.nim old mode 100755 new mode 100644 diff --git a/rod/llvmgen.nim b/rod/llvmgen.nim old mode 100755 new mode 100644 diff --git a/rod/llvmtype.nim b/rod/llvmtype.nim old mode 100755 new mode 100644 diff --git a/rod/lookups.nim b/rod/lookups.nim old mode 100755 new mode 100644 index be4172c868..e545ad3e65 --- a/rod/lookups.nim +++ b/rod/lookups.nim @@ -71,10 +71,9 @@ proc addDeclAt(c: PContext, sym: PSym, at: Natural) = liMessage(sym.info, errAttemptToRedefine, sym.Name.s) proc addOverloadableSymAt(c: PContext, fn: PSym, at: Natural) = - var check: PSym if not (fn.kind in OverloadableSyms): InternalError(fn.info, "addOverloadableSymAt") - check = StrTableGet(c.tab.stack[at], fn.name) + var check = StrTableGet(c.tab.stack[at], fn.name) if (check != nil) and not (check.Kind in OverloadableSyms): liMessage(fn.info, errAttemptToRedefine, fn.Name.s) SymTabAddAt(c.tab, fn, at) diff --git a/rod/magicsys.nim b/rod/magicsys.nim old mode 100755 new mode 100644 diff --git a/rod/main.nim b/rod/main.nim old mode 100755 new mode 100644 diff --git a/rod/msgs.nim b/rod/msgs.nim old mode 100755 new mode 100644 diff --git a/rod/nhashes.nim b/rod/nhashes.nim old mode 100755 new mode 100644 diff --git a/rod/nimconf.nim b/rod/nimconf.nim old mode 100755 new mode 100644 diff --git a/rod/nimrod.cfg b/rod/nimrod.cfg old mode 100755 new mode 100644 diff --git a/rod/nimrod.dot b/rod/nimrod.dot old mode 100755 new mode 100644 diff --git a/rod/nimrod.ini b/rod/nimrod.ini old mode 100755 new mode 100644 diff --git a/rod/nimrod.nim b/rod/nimrod.nim old mode 100755 new mode 100644 diff --git a/rod/nimsets.nim b/rod/nimsets.nim old mode 100755 new mode 100644 diff --git a/rod/nstrtabs.nim b/rod/nstrtabs.nim old mode 100755 new mode 100644 diff --git a/rod/nversion.nim b/rod/nversion.nim old mode 100755 new mode 100644 diff --git a/rod/options.nim b/rod/options.nim old mode 100755 new mode 100644 diff --git a/rod/parsecfg.nim b/rod/parsecfg.nim old mode 100755 new mode 100644 diff --git a/rod/pas2nim/pas2nim.cfg b/rod/pas2nim/pas2nim.cfg old mode 100755 new mode 100644 diff --git a/rod/pas2nim/pas2nim.nim b/rod/pas2nim/pas2nim.nim old mode 100755 new mode 100644 diff --git a/rod/pas2nim/paslex.nim b/rod/pas2nim/paslex.nim old mode 100755 new mode 100644 diff --git a/rod/pas2nim/pasparse.nim b/rod/pas2nim/pasparse.nim old mode 100755 new mode 100644 diff --git a/rod/passaux.nim b/rod/passaux.nim old mode 100755 new mode 100644 diff --git a/rod/passes.nim b/rod/passes.nim old mode 100755 new mode 100644 diff --git a/rod/pbraces.nim b/rod/pbraces.nim old mode 100755 new mode 100644 diff --git a/rod/pendx.nim b/rod/pendx.nim old mode 100755 new mode 100644 diff --git a/rod/platform.nim b/rod/platform.nim old mode 100755 new mode 100644 diff --git a/rod/pnimsyn.nim b/rod/pnimsyn.nim old mode 100755 new mode 100644 diff --git a/rod/pragmas.nim b/rod/pragmas.nim old mode 100755 new mode 100644 diff --git a/rod/procfind.nim b/rod/procfind.nim old mode 100755 new mode 100644 diff --git a/rod/ptmplsyn.nim b/rod/ptmplsyn.nim old mode 100755 new mode 100644 diff --git a/rod/readme.txt b/rod/readme.txt old mode 100755 new mode 100644 diff --git a/rod/rnimsyn.nim b/rod/rnimsyn.nim old mode 100755 new mode 100644 diff --git a/rod/rodread.nim b/rod/rodread.nim old mode 100755 new mode 100644 diff --git a/rod/rodwrite.nim b/rod/rodwrite.nim old mode 100755 new mode 100644 diff --git a/rod/ropes.nim b/rod/ropes.nim old mode 100755 new mode 100644 diff --git a/rod/rst.nim b/rod/rst.nim old mode 100755 new mode 100644 diff --git a/rod/scanner.nim b/rod/scanner.nim old mode 100755 new mode 100644 diff --git a/rod/sem.nim b/rod/sem.nim old mode 100755 new mode 100644 index 90dfd96fff..7ea6338a21 --- a/rod/sem.nim +++ b/rod/sem.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. diff --git a/rod/semdata.nim b/rod/semdata.nim old mode 100755 new mode 100644 diff --git a/rod/semexprs.nim b/rod/semexprs.nim old mode 100755 new mode 100644 diff --git a/rod/semfold.nim b/rod/semfold.nim old mode 100755 new mode 100644 diff --git a/rod/semgnrc.nim b/rod/semgnrc.nim old mode 100755 new mode 100644 diff --git a/rod/seminst.nim b/rod/seminst.nim old mode 100755 new mode 100644 diff --git a/rod/semstmts.nim b/rod/semstmts.nim old mode 100755 new mode 100644 diff --git a/rod/semtempl.nim b/rod/semtempl.nim old mode 100755 new mode 100644 diff --git a/rod/semtypes.nim b/rod/semtypes.nim old mode 100755 new mode 100644 index 71fa178cbc..cf88b0b4b8 --- a/rod/semtypes.nim +++ b/rod/semtypes.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -229,12 +229,10 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = proc semIdentVis(c: PContext, kind: TSymKind, n: PNode, allowed: TSymFlags): PSym = # identifier with visibility - var v: PIdent - result = nil if n.kind == nkPostfix: if (sonsLen(n) == 2) and (n.sons[0].kind == nkIdent): result = newSymS(kind, n.sons[1], c) - v = n.sons[0].ident + var v = n.sons[0].ident if (sfStar in allowed) and (v.id == ord(wStar)): incl(result.flags, sfStar) elif (sfMinus in allowed) and (v.id == ord(wMinus)): diff --git a/rod/sigmatch.nim b/rod/sigmatch.nim old mode 100755 new mode 100644 diff --git a/rod/syntaxes.nim b/rod/syntaxes.nim old mode 100755 new mode 100644 diff --git a/rod/tigen.nim b/rod/tigen.nim old mode 100755 new mode 100644 diff --git a/rod/transf.nim b/rod/transf.nim old mode 100755 new mode 100644 diff --git a/rod/transtmp.nim b/rod/transtmp.nim old mode 100755 new mode 100644 diff --git a/rod/trees.nim b/rod/trees.nim old mode 100755 new mode 100644 diff --git a/rod/treetab.nim b/rod/treetab.nim old mode 100755 new mode 100644 diff --git a/rod/types.nim b/rod/types.nim old mode 100755 new mode 100644 diff --git a/rod/webrepl.nim b/rod/webrepl.nim old mode 100755 new mode 100644 diff --git a/rod/wordrecg.nim b/rod/wordrecg.nim old mode 100755 new mode 100644 diff --git a/start.bat b/start.bat old mode 100755 new mode 100644 diff --git a/tests/99bottles.nim b/tests/99bottles.nim old mode 100755 new mode 100644 diff --git a/tests/cairotest.nim b/tests/cairotest.nim old mode 100755 new mode 100644 diff --git a/tests/cgitest.nim b/tests/cgitest.nim old mode 100755 new mode 100644 diff --git a/tests/csvtest.csv b/tests/csvtest.csv old mode 100755 new mode 100644 diff --git a/tests/curltest.nim b/tests/curltest.nim old mode 100755 new mode 100644 diff --git a/tests/data.csv b/tests/data.csv old mode 100755 new mode 100644 diff --git a/tests/ecmas.html b/tests/ecmas.html old mode 100755 new mode 100644 diff --git a/tests/ecmas.nim b/tests/ecmas.nim old mode 100755 new mode 100644 diff --git a/tests/gcbench.nim b/tests/gcbench.nim old mode 100755 new mode 100644 diff --git a/tests/gctest.nim b/tests/gctest.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex1.nim b/tests/gtk/ex1.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex2.nim b/tests/gtk/ex2.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex3.nim b/tests/gtk/ex3.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex4.nim b/tests/gtk/ex4.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex5.nim b/tests/gtk/ex5.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex6.nim b/tests/gtk/ex6.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex7.nim b/tests/gtk/ex7.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex8.nim b/tests/gtk/ex8.nim old mode 100755 new mode 100644 diff --git a/tests/gtk/ex9.nim b/tests/gtk/ex9.nim old mode 100755 new mode 100644 diff --git a/tests/hallo.nim b/tests/hallo.nim old mode 100755 new mode 100644 diff --git a/tests/jsontest.json b/tests/jsontest.json old mode 100755 new mode 100644 diff --git a/tests/mambsym1.nim b/tests/mambsym1.nim old mode 100755 new mode 100644 diff --git a/tests/mambsym2.nim b/tests/mambsym2.nim old mode 100755 new mode 100644 diff --git a/tests/mambsys1.nim b/tests/mambsys1.nim old mode 100755 new mode 100644 diff --git a/tests/mambsys2.nim b/tests/mambsys2.nim old mode 100755 new mode 100644 diff --git a/tests/mbind3.nim b/tests/mbind3.nim old mode 100755 new mode 100644 diff --git a/tests/mbind4.nim b/tests/mbind4.nim old mode 100755 new mode 100644 diff --git a/tests/minit.nim b/tests/minit.nim old mode 100755 new mode 100644 diff --git a/tests/mnamspc1.nim b/tests/mnamspc1.nim old mode 100755 new mode 100644 diff --git a/tests/mnamspc2.nim b/tests/mnamspc2.nim old mode 100755 new mode 100644 diff --git a/tests/mopaque.nim b/tests/mopaque.nim old mode 100755 new mode 100644 diff --git a/tests/mrecmod.nim b/tests/mrecmod.nim old mode 100755 new mode 100644 diff --git a/tests/mrecmod2.nim b/tests/mrecmod2.nim old mode 100755 new mode 100644 diff --git a/tests/mvarious.nim b/tests/mvarious.nim old mode 100755 new mode 100644 diff --git a/tests/readme.txt b/tests/readme.txt old mode 100755 new mode 100644 diff --git a/tests/rectest.nim b/tests/rectest.nim old mode 100755 new mode 100644 diff --git a/tests/scantest.nim b/tests/scantest.nim old mode 100755 new mode 100644 diff --git a/tests/sdltest.nim b/tests/sdltest.nim old mode 100755 new mode 100644 diff --git a/tests/stckovfl.nim b/tests/stckovfl.nim old mode 100755 new mode 100644 diff --git a/tests/sunset.tmpl b/tests/sunset.tmpl old mode 100755 new mode 100644 diff --git a/tests/t99bott.nim b/tests/t99bott.nim old mode 100755 new mode 100644 diff --git a/tests/tack.nim b/tests/tack.nim old mode 100755 new mode 100644 diff --git a/tests/tadrdisc.nim b/tests/tadrdisc.nim old mode 100755 new mode 100644 diff --git a/tests/tambsym.nim b/tests/tambsym.nim old mode 100755 new mode 100644 diff --git a/tests/tambsym2.nim b/tests/tambsym2.nim old mode 100755 new mode 100644 diff --git a/tests/tambsym3.nim b/tests/tambsym3.nim old mode 100755 new mode 100644 diff --git a/tests/tambsys.nim b/tests/tambsys.nim old mode 100755 new mode 100644 diff --git a/tests/tarray.nim b/tests/tarray.nim old mode 100755 new mode 100644 diff --git a/tests/tarray2.nim b/tests/tarray2.nim old mode 100755 new mode 100644 diff --git a/tests/tarrindx.nim b/tests/tarrindx.nim old mode 100755 new mode 100644 diff --git a/tests/tassert.nim b/tests/tassert.nim old mode 100755 new mode 100644 diff --git a/tests/tassign.nim b/tests/tassign.nim old mode 100755 new mode 100644 diff --git a/tests/tbind1.nim b/tests/tbind1.nim old mode 100755 new mode 100644 diff --git a/tests/tbind2.nim b/tests/tbind2.nim old mode 100755 new mode 100644 diff --git a/tests/tbind3.nim b/tests/tbind3.nim old mode 100755 new mode 100644 diff --git a/tests/tbind4.nim b/tests/tbind4.nim old mode 100755 new mode 100644 diff --git a/tests/tbintre2.nim b/tests/tbintre2.nim old mode 100755 new mode 100644 diff --git a/tests/tbintree.nim b/tests/tbintree.nim old mode 100755 new mode 100644 diff --git a/tests/tblock1.nim b/tests/tblock1.nim old mode 100755 new mode 100644 diff --git a/tests/tcasestm.nim b/tests/tcasestm.nim old mode 100755 new mode 100644 diff --git a/tests/tclosure.nim b/tests/tclosure.nim old mode 100755 new mode 100644 diff --git a/tests/tcmdline.nim b/tests/tcmdline.nim old mode 100755 new mode 100644 diff --git a/tests/tcnstseq.nim b/tests/tcnstseq.nim old mode 100755 new mode 100644 diff --git a/tests/tcolors.nim b/tests/tcolors.nim old mode 100755 new mode 100644 diff --git a/tests/tconsteval.nim b/tests/tconsteval.nim old mode 100755 new mode 100644 diff --git a/tests/tconstr1.nim b/tests/tconstr1.nim old mode 100755 new mode 100644 diff --git a/tests/tconstr2.nim b/tests/tconstr2.nim old mode 100755 new mode 100644 diff --git a/tests/tconvert.nim b/tests/tconvert.nim old mode 100755 new mode 100644 diff --git a/tests/tcopy.nim b/tests/tcopy.nim old mode 100755 new mode 100644 diff --git a/tests/tcurrncy.nim b/tests/tcurrncy.nim old mode 100755 new mode 100644 diff --git a/tests/tdeprecated.nim b/tests/tdeprecated.nim old mode 100755 new mode 100644 diff --git a/tests/tdialogs.nim b/tests/tdialogs.nim old mode 100755 new mode 100644 diff --git a/tests/tdllvar.nim b/tests/tdllvar.nim old mode 100755 new mode 100644 diff --git a/tests/tdumpast.nim b/tests/tdumpast.nim old mode 100755 new mode 100644 diff --git a/tests/techo.nim b/tests/techo.nim old mode 100755 new mode 100644 diff --git a/tests/tendian.nim b/tests/tendian.nim old mode 100755 new mode 100644 diff --git a/tests/tenum.nim b/tests/tenum.nim old mode 100755 new mode 100644 diff --git a/tests/tester.nim b/tests/tester.nim old mode 100755 new mode 100644 diff --git a/tests/tfinally.nim b/tests/tfinally.nim old mode 100755 new mode 100644 diff --git a/tests/tfloat1.nim b/tests/tfloat1.nim old mode 100755 new mode 100644 diff --git a/tests/tfloat2.nim b/tests/tfloat2.nim old mode 100755 new mode 100644 diff --git a/tests/tformat.nim b/tests/tformat.nim old mode 100755 new mode 100644 diff --git a/tests/tforwty.nim b/tests/tforwty.nim old mode 100755 new mode 100644 diff --git a/tests/tforwty2.nim b/tests/tforwty2.nim old mode 100755 new mode 100644 diff --git a/tests/tgtk.nim b/tests/tgtk.nim old mode 100755 new mode 100644 diff --git a/tests/thallo.nim b/tests/thallo.nim old mode 100755 new mode 100644 diff --git a/tests/thintoff.nim b/tests/thintoff.nim old mode 100755 new mode 100644 diff --git a/tests/tident.nim b/tests/tident.nim old mode 100755 new mode 100644 diff --git a/tests/tillrec.nim b/tests/tillrec.nim old mode 100755 new mode 100644 diff --git a/tests/tindent1.nim b/tests/tindent1.nim old mode 100755 new mode 100644 diff --git a/tests/tinit.nim b/tests/tinit.nim old mode 100755 new mode 100644 diff --git a/tests/tinout.nim b/tests/tinout.nim old mode 100755 new mode 100644 diff --git a/tests/tints.nim b/tests/tints.nim old mode 100755 new mode 100644 diff --git a/tests/tinvalidnewseq.nim b/tests/tinvalidnewseq.nim old mode 100755 new mode 100644 diff --git a/tests/tinvwhen.nim b/tests/tinvwhen.nim old mode 100755 new mode 100644 diff --git a/tests/tio.nim b/tests/tio.nim old mode 100755 new mode 100644 diff --git a/tests/tisopr.nim b/tests/tisopr.nim old mode 100755 new mode 100644 diff --git a/tests/titer.nim b/tests/titer.nim old mode 100755 new mode 100644 diff --git a/tests/titer2.nim b/tests/titer2.nim old mode 100755 new mode 100644 diff --git a/tests/titer3.nim b/tests/titer3.nim old mode 100755 new mode 100644 diff --git a/tests/titer4.nim b/tests/titer4.nim old mode 100755 new mode 100644 diff --git a/tests/titer5.nim b/tests/titer5.nim old mode 100755 new mode 100644 diff --git a/tests/tlastmod.nim b/tests/tlastmod.nim old mode 100755 new mode 100644 diff --git a/tests/tlibs.nim b/tests/tlibs.nim old mode 100755 new mode 100644 diff --git a/tests/tloops.nim b/tests/tloops.nim old mode 100755 new mode 100644 diff --git a/tests/tlowhigh.nim b/tests/tlowhigh.nim old mode 100755 new mode 100644 diff --git a/tests/tmath.nim b/tests/tmath.nim old mode 100755 new mode 100644 diff --git a/tests/tmatrix.nim b/tests/tmatrix.nim old mode 100755 new mode 100644 diff --git a/tests/tmultim1.nim b/tests/tmultim1.nim old mode 100755 new mode 100644 diff --git a/tests/tmultim2.nim b/tests/tmultim2.nim old mode 100755 new mode 100644 diff --git a/tests/tnamspc.nim b/tests/tnamspc.nim old mode 100755 new mode 100644 diff --git a/tests/tnestif.nim b/tests/tnestif.nim old mode 100755 new mode 100644 diff --git a/tests/tnestprc.nim b/tests/tnestprc.nim old mode 100755 new mode 100644 diff --git a/tests/tnew.nim b/tests/tnew.nim old mode 100755 new mode 100644 diff --git a/tests/tnewlibs.cfg b/tests/tnewlibs.cfg old mode 100755 new mode 100644 diff --git a/tests/tnewlibs.nim b/tests/tnewlibs.nim old mode 100755 new mode 100644 diff --git a/tests/tnewsets.nim b/tests/tnewsets.nim old mode 100755 new mode 100644 diff --git a/tests/tnewuns.nim b/tests/tnewuns.nim old mode 100755 new mode 100644 diff --git a/tests/tnoop.nim b/tests/tnoop.nim old mode 100755 new mode 100644 diff --git a/tests/tnot.nim b/tests/tnot.nim old mode 100755 new mode 100644 diff --git a/tests/tobjcov.nim b/tests/tobjcov.nim old mode 100755 new mode 100644 diff --git a/tests/tobject2.nim b/tests/tobject2.nim old mode 100755 new mode 100644 diff --git a/tests/tobjects.nim b/tests/tobjects.nim old mode 100755 new mode 100644 diff --git a/tests/toop1.nim b/tests/toop1.nim old mode 100755 new mode 100644 diff --git a/tests/topaque.nim b/tests/topaque.nim old mode 100755 new mode 100644 diff --git a/tests/topena1.nim b/tests/topena1.nim old mode 100755 new mode 100644 diff --git a/tests/topenarrayrepr.nim b/tests/topenarrayrepr.nim old mode 100755 new mode 100644 diff --git a/tests/topenlen.nim b/tests/topenlen.nim old mode 100755 new mode 100644 diff --git a/tests/toptions.nim b/tests/toptions.nim old mode 100755 new mode 100644 diff --git a/tests/tos.nim b/tests/tos.nim old mode 100755 new mode 100644 diff --git a/tests/toverflw.nim b/tests/toverflw.nim old mode 100755 new mode 100644 diff --git a/tests/toverl.nim b/tests/toverl.nim old mode 100755 new mode 100644 diff --git a/tests/toverl2.nim b/tests/toverl2.nim old mode 100755 new mode 100644 diff --git a/tests/toverlop.nim b/tests/toverlop.nim old mode 100755 new mode 100644 diff --git a/tests/toverprc.nim b/tests/toverprc.nim old mode 100755 new mode 100644 diff --git a/tests/toverwr.nim b/tests/toverwr.nim old mode 100755 new mode 100644 diff --git a/tests/tovfint.nim b/tests/tovfint.nim old mode 100755 new mode 100644 diff --git a/tests/tparedef.nim b/tests/tparedef.nim old mode 100755 new mode 100644 diff --git a/tests/tparscfg.nim b/tests/tparscfg.nim old mode 100755 new mode 100644 diff --git a/tests/tparsefloat.nim b/tests/tparsefloat.nim old mode 100755 new mode 100644 diff --git a/tests/tparsopt.nim b/tests/tparsopt.nim old mode 100755 new mode 100644 diff --git a/tests/tpos.nim b/tests/tpos.nim old mode 100755 new mode 100644 diff --git a/tests/tposix.nim b/tests/tposix.nim old mode 100755 new mode 100644 diff --git a/tests/tprep.nim b/tests/tprep.nim old mode 100755 new mode 100644 diff --git a/tests/tprintf.nim b/tests/tprintf.nim old mode 100755 new mode 100644 diff --git a/tests/tprocvar.nim b/tests/tprocvar.nim old mode 100755 new mode 100644 diff --git a/tests/tpush.nim b/tests/tpush.nim old mode 100755 new mode 100644 diff --git a/tests/tquicksort.nim b/tests/tquicksort.nim old mode 100755 new mode 100644 diff --git a/tests/tquit.nim b/tests/tquit.nim old mode 100755 new mode 100644 diff --git a/tests/tquotewords.nim b/tests/tquotewords.nim old mode 100755 new mode 100644 diff --git a/tests/tradix.nim b/tests/tradix.nim old mode 100755 new mode 100644 diff --git a/tests/trawstr.nim b/tests/trawstr.nim old mode 100755 new mode 100644 diff --git a/tests/treadln.nim b/tests/treadln.nim old mode 100755 new mode 100644 diff --git a/tests/treadx.nim b/tests/treadx.nim old mode 100755 new mode 100644 diff --git a/tests/trecinca.nim b/tests/trecinca.nim old mode 100755 new mode 100644 diff --git a/tests/trecincb.nim b/tests/trecincb.nim old mode 100755 new mode 100644 diff --git a/tests/treciter.nim b/tests/treciter.nim old mode 100755 new mode 100644 diff --git a/tests/trecmod.nim b/tests/trecmod.nim old mode 100755 new mode 100644 diff --git a/tests/trecmod2.nim b/tests/trecmod2.nim old mode 100755 new mode 100644 diff --git a/tests/trectype.nim b/tests/trectype.nim old mode 100755 new mode 100644 diff --git a/tests/trefs.nim b/tests/trefs.nim old mode 100755 new mode 100644 diff --git a/tests/tregex.nim b/tests/tregex.nim old mode 100755 new mode 100644 diff --git a/tests/treguse.nim b/tests/treguse.nim old mode 100755 new mode 100644 diff --git a/tests/trepr.nim b/tests/trepr.nim old mode 100755 new mode 100644 diff --git a/tests/tromans.nim b/tests/tromans.nim old mode 100755 new mode 100644 diff --git a/tests/tseq2.nim b/tests/tseq2.nim old mode 100755 new mode 100644 diff --git a/tests/tseqcon.nim b/tests/tseqcon.nim old mode 100755 new mode 100644 diff --git a/tests/tseqcon2.nim b/tests/tseqcon2.nim old mode 100755 new mode 100644 diff --git a/tests/tsets.nim b/tests/tsets.nim old mode 100755 new mode 100644 diff --git a/tests/tsidee1.nim b/tests/tsidee1.nim old mode 100755 new mode 100644 diff --git a/tests/tsidee2.nim b/tests/tsidee2.nim old mode 100755 new mode 100644 diff --git a/tests/tsidee3.nim b/tests/tsidee3.nim old mode 100755 new mode 100644 diff --git a/tests/tsidee4.nim b/tests/tsidee4.nim old mode 100755 new mode 100644 diff --git a/tests/tsimmeth.nim b/tests/tsimmeth.nim old mode 100755 new mode 100644 diff --git a/tests/tsimtych.nim b/tests/tsimtych.nim old mode 100755 new mode 100644 diff --git a/tests/tsizeof.nim b/tests/tsizeof.nim old mode 100755 new mode 100644 diff --git a/tests/tsockets.nim b/tests/tsockets.nim old mode 100755 new mode 100644 diff --git a/tests/tsplit.nim b/tests/tsplit.nim old mode 100755 new mode 100644 diff --git a/tests/tstatret.nim b/tests/tstatret.nim old mode 100755 new mode 100644 diff --git a/tests/tstmtexp.nim b/tests/tstmtexp.nim old mode 100755 new mode 100644 diff --git a/tests/tstrace.nim b/tests/tstrace.nim old mode 100755 new mode 100644 diff --git a/tests/tstrange.nim b/tests/tstrange.nim old mode 100755 new mode 100644 diff --git a/tests/tstrdesc.nim b/tests/tstrdesc.nim old mode 100755 new mode 100644 diff --git a/tests/tstrdist.nim b/tests/tstrdist.nim old mode 100755 new mode 100644 diff --git a/tests/tstreams.nim b/tests/tstreams.nim old mode 100755 new mode 100644 diff --git a/tests/tstrlits.nim b/tests/tstrlits.nim old mode 100755 new mode 100644 diff --git a/tests/tstrset.nim b/tests/tstrset.nim old mode 100755 new mode 100644 diff --git a/tests/tstrtabs.nim b/tests/tstrtabs.nim old mode 100755 new mode 100644 diff --git a/tests/tstrutil.nim b/tests/tstrutil.nim old mode 100755 new mode 100644 diff --git a/tests/ttempl.nim b/tests/ttempl.nim old mode 100755 new mode 100644 diff --git a/tests/ttempl2.nim b/tests/ttempl2.nim old mode 100755 new mode 100644 diff --git a/tests/ttempl3.nim b/tests/ttempl3.nim old mode 100755 new mode 100644 diff --git a/tests/ttime.nim b/tests/ttime.nim old mode 100755 new mode 100644 diff --git a/tests/ttuple1.nim b/tests/ttuple1.nim old mode 100755 new mode 100644 diff --git a/tests/tunderscores.nim b/tests/tunderscores.nim old mode 100755 new mode 100644 diff --git a/tests/tvardecl.nim b/tests/tvardecl.nim old mode 100755 new mode 100644 diff --git a/tests/tvarious.nim b/tests/tvarious.nim old mode 100755 new mode 100644 diff --git a/tests/tvarnums.nim b/tests/tvarnums.nim old mode 100755 new mode 100644 diff --git a/tests/tvartup.nim b/tests/tvartup.nim old mode 100755 new mode 100644 diff --git a/tests/twalker.nim b/tests/twalker.nim old mode 100755 new mode 100644 diff --git a/tests/typalias.nim b/tests/typalias.nim old mode 100755 new mode 100644 diff --git a/tests/typredef.nim b/tests/typredef.nim old mode 100755 new mode 100644 diff --git a/tests/wingui.nim b/tests/wingui.nim old mode 100755 new mode 100644 diff --git a/tests/x11test.nim b/tests/x11test.nim old mode 100755 new mode 100644 diff --git a/tests/xmltest.html b/tests/xmltest.html old mode 100755 new mode 100644 diff --git a/tools/build.tmpl b/tools/build.tmpl old mode 100755 new mode 100644 diff --git a/tools/cmerge.nim b/tools/cmerge.nim old mode 100755 new mode 100644 diff --git a/tools/deinstall.tmpl b/tools/deinstall.tmpl old mode 100755 new mode 100644 diff --git a/tools/inno.tmpl b/tools/inno.tmpl old mode 100755 new mode 100644 diff --git a/tools/install.tmpl b/tools/install.tmpl old mode 100755 new mode 100644 diff --git a/tools/niminst.nim b/tools/niminst.nim old mode 100755 new mode 100644 diff --git a/tools/nimrepl.nim b/tools/nimrepl.nim new file mode 100644 index 0000000000..6e4e3faaa1 --- /dev/null +++ b/tools/nimrepl.nim @@ -0,0 +1,160 @@ +import glib2, gtk2, gdk2, osproc, dialogs + +type + output = tuple[compiler, app: string] + +proc execCode(code: string): output = + + var f: TFile + if open(f, "temp.nim", fmWrite): + f.write(code) + f.close() + else: + raise newException(EIO, "Unable to open file") + + var compilerOutput = osproc.execProcess("nimrod c temp.nim") + var appOutput = osproc.execProcess("temp.exe") + return (compilerOutput, appOutput) + +var shiftPressed = False +var w: PGtkWindow +var InputTextBuffer: PGtkTextBuffer +var OutputTextBuffer: PGtkTextBuffer + +proc destroy(widget: PGtkWidget, data: pgpointer){.cdecl.} = + gtk_main_quit() + +proc FileOpenClicked(menuitem: PGtkMenuItem, userdata: pgpointer) = + var path = ChooseFileToOpen(w) + + if path != "": + + var file: string = readFile(path) + if file != nil: + gtk_text_buffer_set_text(InputTextBuffer, file, len(file)) + + else: + error(w, "Unable to read from file") + +proc FileSaveClicked(menuitem: PGtkMenuItem, userdata: pgpointer) = + var path = ChooseFileToSave(w) + + if path != "": + var startIter: TGtkTextIter + var endIter: TGtkTextIter + gtk_text_buffer_get_start_iter(InputTextBuffer, addr(startIter)) + gtk_text_buffer_get_end_iter(InputTextBuffer, addr(endIter)) + var InputText = gtk_text_buffer_get_text(InputTextBuffer, addr(startIter), addr(endIter), False) + + var f: TFile + if open(f, path, fmWrite): + f.write(InputText) + f.close() + else: + error(w, "Unable to write to file") + + +proc inputKeyPressed(widget: PGtkWidget, event: PGdkEventKey, userdata: pgpointer): bool = + if event.keyval == 65505: + # SHIFT is pressed + shiftPressed = True + + return False +proc inputKeyReleased(widget: PGtkWidget, event: PGdkEventKey, userdata: pgpointer): bool = + if event.keyval == 65505: + # SHIFT is released + shiftPressed = False + + if event.keyval == 65293: + # Enter pressed + if shiftPressed == False: + var startIter: TGtkTextIter + var endIter: TGtkTextIter + gtk_text_buffer_get_start_iter(InputTextBuffer, addr(startIter)) + gtk_text_buffer_get_end_iter(InputTextBuffer, addr(endIter)) + var InputText = gtk_text_buffer_get_text(InputTextBuffer, addr(startIter), addr(endIter), False) + + try: + var r: output = execCode($InputText) + gtk_text_buffer_set_text(OutputTextBuffer, r[0] & r[1], len(r[0] & r[1])) + except: + gtk_text_buffer_set_text(OutputTextBuffer, "Error: Could not open file temp.nim", len("Error: Could not open file temp.nim")) + + return False + +proc initControls() = + w = gtk_window_new(GTK_WINDOW_TOPLEVEL) + gtk_window_set_default_size(w, 500, 600) + gtk_window_set_title(w, "Nimrod REPL") + discard gtk_signal_connect(GTKOBJECT(w), "destroy", + GTK_SIGNAL_FUNC(destroy), nil) + + # MainBox (vbox) + var MainBox: PGtkWidget = gtk_vbox_new(False, 0) + gtk_container_add(GTK_Container(w), MainBox) + + # TopMenu (MenuBar) + var TopMenu: PGtkWidget = gtk_menu_bar_new() + gtk_widget_show(TopMenu) + + var FileMenu = gtk_menu_new() + var OpenMenuItem = gtk_menu_item_new_with_label("Open") + gtk_menu_append(FileMenu, OpenMenuItem) + gtk_widget_show(OpenMenuItem) + discard gtk_signal_connect(GTKOBJECT(OpenMenuItem), "activate", + GTK_SIGNAL_FUNC(FileOpenClicked), nil) + var SaveMenuItem = gtk_menu_item_new_with_label("Save...") + gtk_menu_append(FileMenu, SaveMenuItem) + gtk_widget_show(SaveMenuItem) + discard gtk_signal_connect(GTKOBJECT(SaveMenuItem), "activate", + GTK_SIGNAL_FUNC(FileSaveClicked), nil) + var FileMenuItem = gtk_menu_item_new_with_label("File") + + + gtk_menu_item_set_submenu(FileMenuItem, FileMenu) + gtk_widget_show(FileMenuItem) + gtk_menu_bar_append(TopMenu, FileMenuItem) + + gtk_box_pack_start(GTK_Box(MainBox), TopMenu, False, False, 0) + + # VPaned - Seperates the InputTextView and the OutputTextView + var paned = gtk_vpaned_new() + gtk_paned_set_position(paned, 450) + gtk_box_pack_start(GTK_Box(MainBox), paned, True, True, 0) + gtk_widget_show(paned) + + # Init the TextBuffers + InputTextBuffer = gtk_text_buffer_new(nil) + OutputTextBuffer = gtk_text_buffer_new(nil) + + # InputTextView (TextView) + var InputScrolledWindow = gtk_scrolled_window_new(nil, nil) + gtk_scrolled_window_set_policy(InputScrolledWindow, + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC) + var InputTextView = gtk_text_view_new_with_buffer(InputTextBuffer) + gtk_scrolled_window_add_with_viewport(InputScrolledWindow, InputTextView) + gtk_paned_add1(paned, InputScrolledWindow) + gtk_widget_show(InputScrolledWindow) + gtk_widget_show(InputTextView) + + discard gtk_signal_connect(GTKOBJECT(InputTextView), "key-release-event", + GTK_SIGNAL_FUNC(inputKeyReleased), nil) + discard gtk_signal_connect(GTKOBJECT(InputTextView), "key-press-event", + GTK_SIGNAL_FUNC(inputKeyPressed), nil) + + # OutputTextView (TextView) + var OutputScrolledWindow = gtk_scrolled_window_new(nil, nil) + gtk_scrolled_window_set_policy(OutputScrolledWindow, + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC) + var OutputTextView = gtk_text_view_new_with_buffer(OutputTextBuffer) + gtk_scrolled_window_add_with_viewport(OutputScrolledWindow, OutputTextView) + gtk_paned_add2(paned, OutputScrolledWindow) + gtk_widget_show(OutputScrolledWindow) + gtk_widget_show(OutputTextView) + + gtk_widget_show(w) + gtk_widget_show(MainBox) + +gtk_nimrod_init() +initControls() +gtk_main() \ No newline at end of file diff --git a/tools/nimweb.nim b/tools/nimweb.nim old mode 100755 new mode 100644 diff --git a/tools/noprefix.nim b/tools/noprefix.nim old mode 100755 new mode 100644 diff --git a/tools/sunset.tmpl b/tools/sunset.tmpl old mode 100755 new mode 100644 diff --git a/tools/trimcc.nim b/tools/trimcc.nim old mode 100755 new mode 100644 diff --git a/web/community.txt b/web/community.txt old mode 100755 new mode 100644 diff --git a/web/documentation.txt b/web/documentation.txt old mode 100755 new mode 100644 diff --git a/web/download.txt b/web/download.txt old mode 100755 new mode 100644 diff --git a/web/index.txt b/web/index.txt old mode 100755 new mode 100644 diff --git a/web/links.txt b/web/links.txt old mode 100755 new mode 100644 diff --git a/web/news.txt b/web/news.txt old mode 100755 new mode 100644 index b4f3551d18..84daa490e2 --- a/web/news.txt +++ b/web/news.txt @@ -19,6 +19,7 @@ Bugfixes - ``system.write(f: TFile, s: string)`` now works even if ``s`` contains binary zeros. - Fixed a bug in ``os.setFilePermissions`` for Windows. +- An overloadable symbol can now have the same name as an imported module. Additions diff --git a/web/nimrod.ini b/web/nimrod.ini old mode 100755 new mode 100644 diff --git a/web/question.txt b/web/question.txt old mode 100755 new mode 100644 diff --git a/web/snippets/snippet1.nim b/web/snippets/snippet1.nim old mode 100755 new mode 100644 diff --git a/web/ticker.txt b/web/ticker.txt old mode 100755 new mode 100644