summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-12-21 16:02:41 -0500
committerAdrian Thurston <thurston@complang.org>2012-12-21 16:02:41 -0500
commitfd6837662f72e7c3afba97af722db7c82ed79138 (patch)
tree685f49fb7953b0ddfb0faba47ef51d235b147411
parent02e14456d8ad8dfcd9632399b9fec7c6135a1562 (diff)
downloadcolm-fd6837662f72e7c3afba97af722db7c82ed79138.tar.gz
verify namespace start end names
-rw-r--r--colm/lmparse.kl5
-rw-r--r--test/tags3.lm2
2 files changed, 6 insertions, 1 deletions
diff --git a/colm/lmparse.kl b/colm/lmparse.kl
index 4b3914fb..5f3adb38 100644
--- a/colm/lmparse.kl
+++ b/colm/lmparse.kl
@@ -482,6 +482,8 @@ region_head:
namespace_def:
namespace_head root_item_list KW_End TK_Word
final {
+ if ( strcmp( namespaceStack.top()->name, $4->data ) != 0 )
+ error($4->loc) << "namespace end name does not match begin name" << endp;
namespaceStack.pop();
};
@@ -535,6 +537,9 @@ context_item_list:
context_def:
context_head context_item_list KW_End TK_Word
final {
+ if ( strcmp( namespaceStack.top()->name, $4->data ) != 0 )
+ error($4->loc) << "context end name does not match begin name" << endp;
+
contextStack.pop();
namespaceStack.pop();
};
diff --git a/test/tags3.lm b/test/tags3.lm
index 1f7fe2f2..0e05a90b 100644
--- a/test/tags3.lm
+++ b/test/tags3.lm
@@ -295,7 +295,7 @@ context tags
# }
# }
# }
-end tag
+end tags
cons Tags: tags[]
Tags.TagStack = construct tags::tag_stack []