From 7f7d8d5f7246089fc4b5bb35a2f381f544930126 Mon Sep 17 00:00:00 2001 From: Felix Auringer Date: Tue, 14 Jul 2020 15:26:54 +0200 Subject: [PATCH 1/2] Clamp interval end to sourcemap size --- .../OhmSourceMapping.class/instance/terminalExpression..st | 5 +++-- .../OhmSourceMapping.class/methodProperties.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st b/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st index b5f178c..91a111d 100644 --- a/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st +++ b/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st @@ -1,5 +1,6 @@ standard attributes terminalExpression: aNode - aNode interval start to: aNode interval end do: [:i | - (self sourceMap at: i) add: aNode] \ No newline at end of file + aNode interval start + to: (aNode interval end min: self sourceMap size) + do: [:i | (self sourceMap at: i) add: aNode] \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmSourceMapping.class/methodProperties.json b/packages/Ohm-Core.package/OhmSourceMapping.class/methodProperties.json index 36868fc..00c0d5b 100644 --- a/packages/Ohm-Core.package/OhmSourceMapping.class/methodProperties.json +++ b/packages/Ohm-Core.package/OhmSourceMapping.class/methodProperties.json @@ -6,4 +6,4 @@ "defaultExpression:" : "pre 7/13/2020 11:02", "sourceMap" : "pre 4/29/2020 10:20", "sourceMap:" : "pre 4/29/2020 10:20", - "terminalExpression:" : "pre 7/13/2020 11:01" } } + "terminalExpression:" : "fau 7/14/2020 15:24" } } From 8afcaeb95f6b9752e2e162f6413578fc2cd7217a Mon Sep 17 00:00:00 2001 From: Felix Auringer Date: Thu, 16 Jul 2020 16:22:00 +0200 Subject: [PATCH 2/2] Handle special root node case --- .../Ohm-Core.package/OhmNode.class/instance/enclosingRule.st | 1 + packages/Ohm-Core.package/OhmNode.class/methodProperties.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/Ohm-Core.package/OhmNode.class/instance/enclosingRule.st b/packages/Ohm-Core.package/OhmNode.class/instance/enclosingRule.st index bf62366..9dbc6ae 100644 --- a/packages/Ohm-Core.package/OhmNode.class/instance/enclosingRule.st +++ b/packages/Ohm-Core.package/OhmNode.class/instance/enclosingRule.st @@ -3,6 +3,7 @@ enclosingRule | aParent | aParent := self parent. + aParent ifNil: [ ^ self ]. [aParent ruleName = OhmParsingExpression listRuleIdentifier] whileTrue: [ aParent := aParent parent]. ^ aParent \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmNode.class/methodProperties.json b/packages/Ohm-Core.package/OhmNode.class/methodProperties.json index e07e36f..3c26c81 100644 --- a/packages/Ohm-Core.package/OhmNode.class/methodProperties.json +++ b/packages/Ohm-Core.package/OhmNode.class/methodProperties.json @@ -6,7 +6,7 @@ "calculateSourceMap" : "pre 7/13/2020 10:41", "children" : "pre 1/5/2015 16:06", "children:" : "pre 1/5/2015 16:06", - "enclosingRule" : "pre 7/13/2020 11:20", + "enclosingRule" : "fau 7/16/2020 16:17", "grammar" : "pre 1/5/2015 15:38", "grammar:" : "pre 1/5/2015 15:38", "initialize" : "pre 11/21/2017 15:29",