From 123f667b9b8e2c37f13f3fc0f5176863f15dd5c5 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Mon, 2 Aug 2010 20:17:43 +0000 Subject: Fix for matching names in regexps, restores behaviour of name-aware code such as imenu. --- isar/isar-syntax.el | 8 +++++++- isar/isar.el | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'isar') diff --git a/isar/isar-syntax.el b/isar/isar-syntax.el index 588af049..e689fa9d 100644 --- a/isar/isar-syntax.el +++ b/isar/isar-syntax.el @@ -513,11 +513,17 @@ matches contents of quotes for quoted identifiers.") isar-keywords-theory-script isar-keywords-theory-goal)) +(defconst isar-entity-regexp + (concat "\\(" (isar-ids-to-regexp isar-keywords-imenu) "\\)")) + (defconst isar-named-entity-regexp - (concat "\\(" (isar-ids-to-regexp isar-keywords-imenu) "\\)" + (concat isar-entity-regexp "\\(?:\\s-*(\\s-*in[^)]+)\\)?" isar-name-regexp "[[:=]" )) +(defconst isar-named-entity-name-match-number + (1+ (regexp-opt-depth isar-entity-regexp))) + (defconst isar-generic-expression (mapcar (lambda (kw) (list (capitalize kw) diff --git a/isar/isar.el b/isar/isar.el index 9d493fb3..479e4c34 100644 --- a/isar/isar.el +++ b/isar/isar.el @@ -112,7 +112,7 @@ See -k option for Isabelle interface script." proof-save-command-regexp isar-save-command-regexp proof-goal-command-regexp isar-goal-command-regexp proof-goal-with-hole-regexp isar-named-entity-regexp - proof-goal-with-hole-result 2 + proof-goal-with-hole-result isar-named-entity-name-match-number proof-save-with-hole-regexp nil proof-script-imenu-generic-expression isar-generic-expression imenu-syntax-alist isar-script-syntax-table-alist -- cgit v1.2.3