===============================================================================
CHANGELOG - Enhanced JavaScript Mode for Epsilon 14.06
===============================================================================

2025-10-31 - Version 1.0.5 - Lisp Mode Bug Fixes
===============================================================================

FIXED (shane/lispmode.e):
  - Fixed potential "coloring internal error" issues in Lisp mode:

  Bug 1: Missing bounds check before character(t + 1)
    - In color_lisp_range, when processing '#' character
    - Could access beyond buffer if '#' is at end of file
    - Added: if (t + 1 < size()) check before character(t + 1)

  Bug 2: Infinite loop potential in color_lisp_range
    - Default case in '#' switch didn't advance point
    - Final else clause didn't advance point
    - Could match same character repeatedly if not handled in main branches
    - Added: Explicit point advancement (point = t + 1 or point = t + 2)
    - Added: Safety check after each loop iteration to ensure point advanced

  Bug 3: Invalid range for embedded C code coloring
    - lisp_color_c_range(t + 2, point - 2) didn't check bounds
    - Could pass invalid range if point < t + 4
    - Added: Bounds check before calling lisp_color_c_range

  - Added comprehensive tracing system for debugging:
    - lisp_trace(msg) - Log message to #lisp-debug# buffer
    - lisp_trace_pos(msg, pos) - Log position
    - lisp_trace_range(msg, from, to) - Log range
    - Controlled by LISP_TRACE_ENABLED flag (default: 0)

  - Created test file: test/test-lisp.lsp with edge cases
  - Files updated: shane/lispmode.e

2025-10-31 - Version 1.0.4
===============================================================================

FIXED:
  - Fixed "coloring internal error 2" - MULTIPLE BUGS:

  Bug 1: c_init_color(to, t) was called with t=matchstart instead of t=point
    - This caused invalid color range (start > end) when loop exited normally
    - Changed: c_init_color(to, t) → c_init_color(to, point)

  Bug 2: If JSX tag parsing failed, point wasn't advanced past '<'
    - This caused regex to match the same '<' repeatedly → infinite loop
    - Added: Ensure point always advances past start before returning

  Bug 3: Negative array index when match at start of buffer (t=0)
    - Lines 375 & 396: set_character_color(t - 1, ...) where t=0 → t-1=-1
    - This caused error when typing characters at start of file
    - Added: Check (t > 0) before using t - 1

  Bug 4: c_init_color called with point < to when re_search fails
    - When regex doesn't match (e.g., minimal_coloring enabled), point never advances
    - Called c_init_color(to, point) where point < to → invalid range
    - Added: Ensure point >= to before calling c_init_color

  Bug 5: Epsilon regex metacharacters not properly escaped
    - $ in character class [A-Za-z_$] was interpreted as end-of-line anchor
    - < in pattern was interpreted as special character syntax (<Tab>, etc.)
    - Fixed: Escaped as %$ and %< per Epsilon regex syntax
    - Pattern now correctly matches JavaScript identifiers with $ (like $variable)

  - Added tracing system using bprintf() to #js-debug# buffer for debugging
  - Files updated: js-mode.e (both copies in root and shane/)
  - Tracing disabled by default (set TRACE_ENABLED=1 to enable)

2025-10-31 - Version 1.0.3
===============================================================================

FIXED:
  - Fixed "coloring internal error 2" caused by nested save_var conflicts
  - Simplified color_narrowed_c_range to avoid recursion issues
    (now colors entire JSX expression as identifier instead of parsing)
  - Simplified color_js_template_literal to avoid point manipulation conflicts
    (template literals colored as strings, ${} expressions not separately colored)
  - Added bounds checking for character access (p + 1 < size())
  - Trade-off: Less sophisticated coloring inside JSX {} and template literals,
    but much faster and no crashes
  - Files updated: js-mode.e (both copies in root and shane/)

2025-10-31 - Version 1.0.2
===============================================================================

FIXED:
  - Implemented missing function: color_js_template_literal
  - Implemented missing function: color_narrowed_c_range
  - Added forward declaration for color_js_template_literal
  - These functions were declared/called but not implemented, causing
    compilation errors
  - color_js_template_literal handles template literals with ${} expressions
  - color_narrowed_c_range provides C-style coloring for JSX expressions
  - Removed unused variables: tag_start, self_closing in color_jsx_tag
  - Files updated: js-mode.e (both copies in root and shane/)
  - Compiles cleanly with no warnings or errors

2025-10-31 - Version 1.0.1
===============================================================================

FIXED:
  - Added forward declarations to fix "undeclared variable" error
  - Error was: "undeclared variable color_js_es2015_range"
  - Added declarations for: color_js_es2015_range, do_color_js_es2015_range,
    color_json_range, js_keyword_color, at_jsx_tag, color_jsx_tag,
    is_js_es2015_keyword, color_narrowed_c_range
  - Files updated: js-mode.e (both copies)

2025-10-31 - Version 1.0.0
===============================================================================

INITIAL RELEASE:

CREATED:
  - js-mode.e - Enhanced JavaScript mode with ES2015+ and JSX
  - Enhanced shane directory with integrated js-mode
  - Complete documentation suite
  - Test files for ES2015+, JSX, and JSON
  - Installation scripts

FEATURES:
  - ES2015+ keywords (let, const, async, await, yield, static, get, set, etc.)
  - Arrow function syntax (=>)
  - Template literals with ${expressions}
  - JSX syntax highlighting for React
  - JSX tags, attributes, expressions, fragments
  - JSON mode
  - All C-mode features (indentation, delimiter matching, comments)

DOCUMENTATION:
  - START-HERE.txt - Quick start guide
  - README.md - Complete documentation
  - QUICKSTART.md - 5-minute setup
  - INSTALLATION-SUMMARY.txt - Installation details
  - shane/README-INSTALL.txt - Shane-specific instructions
  - colcode.e.patch - Alternative installation method

TEST FILES:
  - test-es2015.js - ES2015+ feature demonstrations
  - test-jsx.jsx - JSX/React examples
  - test-json.json - JSON formatting

INSTALLATION TOOLS:
  - shane/install.cmd - Quick installer from shane directory
  - shane/make.cmd - Compile all .e files at once

===============================================================================
