1. 13 May, 2017 2 commits
    • Philipp's avatar
      Make `old-style-backquotes' variable internal · a1d46159
      Philipp authored
      * src/lread.c (load_warn_old_style_backquotes, Fload, read1)
      (syms_of_lread): Rename `old-style-backquotes' to
      `lread--old-style-backquotes', and clarify that it's for internal
      use only.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename
      variable.
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
      unit test.
      * emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--old-style-backquotes): Add unit test.
      a1d46159
    • Philipp Stephani's avatar
      Improve unescaped character literal warnings · 16004397
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals)
      (syms_of_lread):
      lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve
      formatting of unescaped character literal warnings.
      
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
      test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
      16004397
  2. 10 May, 2017 2 commits
    • Glenn Morris's avatar
      Fix finding test .el files · 48e6e9a9
      Glenn Morris authored
      * test/Makefile.in (ELFILES): Exclude the data/ directory.
      * test/src/lread-tests.el (lread-test-bug26837): Revert previous.
      48e6e9a9
    • Tino Calancha's avatar
      Tweak a recent test · 4f391b9d
      Tino Calancha authored
      This test fails in my local machine because the data files
      are compiled, and the test doesn't expect that.
      * test/src/lread-tests.el (lread-test-bug26837): Match a suffix
      ending with '.elc' when the data files are compiled.
      4f391b9d
  3. 09 May, 2017 1 commit
    • Glenn Morris's avatar
      Put re-loaded file back at start of load-history (bug#26837) · db30296b
      Glenn Morris authored
      * src/lread.c (readevalloop): Fix the "whole buffer" check to
      operate in the correct buffer.
      (Feval_buffer): Move point back to the start after checking
      for lexical binding.
      * test/src/lread-tests.el (lread-test-bug26837): New test.
      * test/data/somelib.el, test/data/somelib2.el: New test data files.
      db30296b
  4. 01 May, 2017 1 commit
    • Philipp Stephani's avatar
      Warn about missing backslashes during load · c2bbdc33
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals, Fload, read1)
      (syms_of_lread): Warn if unescaped character literals are
      found (Bug#20152).
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for
      unescaped character literals during byte compilation.
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals): New
      unit test.
      (lread-tests--with-temp-file, lread-tests--last-message): Helper
      functions for unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): New unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file):
      Helper macro for unit test.
      c2bbdc33
  5. 08 Apr, 2017 1 commit
  6. 01 Jan, 2017 1 commit
  7. 23 Dec, 2016 1 commit
    • Philipp Stephani's avatar
      Treat incomplete integer literals as errors · 6eaadcc7
      Philipp Stephani authored
      See Bug#25120.
      
      * src/lread.c (read_integer): Treat incomplete integer literals as errors.
      * test/src/lread-tests.el (lread-empty-int-literal): New unit test for
      incomplete integer literals.
      6eaadcc7
  8. 25 Apr, 2016 1 commit
    • Paul Eggert's avatar
      New function ‘char-from-name’ · 86d08343
      Paul Eggert authored
      This also fixes the mishandling of "\N{CJK COMPATIBILITY
      IDEOGRAPH-F900}", "\N{VARIATION SELECTOR-1}", etc.
      Problem reported by Eli Zaretskii in:
      http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00614.html
      * doc/lispref/nonascii.texi (Character Codes), etc/NEWS: Document this.
      * lisp/international/mule-cmds.el (char-from-name): New function.
      (read-char-by-name): Use it.  Document that "BED" is treated as
      a name, not as a hexadecimal number.  Reject out-of-range integers,
      floating-point numbers, and strings with trailing junk.
      * src/lread.c (character_name_to_code): Call char-from-name
      instead of inspecting ucs-names directly, so that we handle
      computed names like "VARIATION SELECTOR-1".  Do not use an auto
      string, since char-from-name might GC.
      * test/src/lread-tests.el: Add tests for new behavior, and
      fix some old tests that were wrong.
      86d08343
  9. 22 Apr, 2016 3 commits
    • Paul Eggert's avatar
      Improve character name escapes · bd1c7ca6
      Paul Eggert authored
      * doc/lispref/nonascii.texi (Character Properties):
      Avoid duplication of Unicode names.  Reformat examples to fit in
      narrow pages.
      * doc/lispref/objects.texi (General Escape Syntax):
      Simplify and better-organize explanation of \N{...} escapes.
      * src/character.h (CHAR_SURROGATE_PAIR_P): Remove; unused.
      (char_surrogate_p): New inline function.
      * src/lread.c: Do not include string.h; no longer needed.
      (invalid_character_name, check_scalar_value): Remove; the ideas
      behind these functions are now bundled into character_name_to_code.
      (character_name_to_code): Remove undocumented support for "CJK
      IDEOGRAPH-XXXX" names, as "U+XXXX" suffices.  Reject monstrosities
      like "\N{U+-0}" and null bytes in \N escapes.  Reject floating
      point in \N escapes instead of returning garbage.  Use
      AUTO_STRING_WITH_LEN to lessen pressure on the garbage collector.
      * test/src/lread-tests.el (lread-char-number, lread-char-name)
      (lread-string-char-number, lread-string-char-name):
      Test runtime behavior, not compile-time, as the test framework
      is not set up to test compile-time.
      (lread-char-surrogate-1, lread-char-surrogate-2)
      (lread-char-surrogate-3, lread-char-surrogate-4)
      (lread-string-char-number-2, lread-string-char-number-3):
      New tests.
      (lread-string-char-number-1): Rename from lread-string-char-number.
      bd1c7ca6
    • Philipp Stephani's avatar
      Use 'ucs-names' for character name escapes · e7cb38ed
      Philipp Stephani authored
      * lread.c (invalid_character_name, check_scalar_value)
      (parse_code_after_prefix, character_name_to_code): New helper
      functions that use 'ucs-names' and parsing for CJK ideographs.
      (read_escape): Use helper functions.
      (syms_of_lread): New symbol 'ucs-names'.
      * test/src/lread-tests.el: New tests; fix a couple of bugs in
      existing tests.
      e7cb38ed
    • Philipp Stephani's avatar
      Implement named character escapes, similar to Perl · de7d5f36
      Philipp Stephani authored
      * lread.c (init_character_names): New function.
      (read_escape): Read Perl-style named character escape sequences.
      (syms_of_lread): Initialize new variable 'character_names'.
      * test/src/lread-tests.el (lread-char-empty-name): Add test file
      for src/lread.c.
      de7d5f36