PageRenderTime 35ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/diff-js.ss

http://github.com/yinwang0/ydiff
Scheme | 49 lines | 10 code | 18 blank | 21 comment | 0 complexity | f7f19548a058d78d10676e8bdbffd2fb MD5 | raw file
Possible License(s): GPL-3.0
  1. ;; ydiff - a language-aware tool for comparing programs
  2. ;; Copyright (C) 2011 Yin Wang (yinwang0@gmail.com)
  3. ;; This program is free software: you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;; This program is distributed in the hope that it will be useful,
  8. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ;; GNU General Public License for more details.
  11. ;; You should have received a copy of the GNU General Public License
  12. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. (load "parse-js.ss")
  14. (load "diff.ss")
  15. ;-------------------------------------------------------------
  16. ; overrides
  17. ;-------------------------------------------------------------
  18. (define get-name
  19. (lambda (node)
  20. (let ([id-exp (match-tags node '(name identifier id))])
  21. (and id-exp (get-symbol (car (Expr-elts id-exp)))))))
  22. ;; (same-def? (car (parse1 $statement "function f(x) {}"))
  23. ;; (car (parse1 $statement "function f(x) {}")))
  24. ;; (different-def? (car (parse1 $statement "function f(x) {}"))
  25. ;; (car (parse1 $statement "function g(x) {}")))
  26. ;---------------------------------------------
  27. (define diff-js
  28. (lambda (file1 file2)
  29. (load "diff-js.ss")
  30. (diff file1 file2 parse-js)))
  31. ; (diff-js "tests/nav.js" "tests/nav-div.js")