Skip to content

Commit

Permalink
Finishes work on not using the ParsingState objects as the identifier…
Browse files Browse the repository at this point in the history
… of a parsing process but an empty token object. Should reduce memory footprint even further and tackle for example #66.
  • Loading branch information
codeZeilen committed May 4, 2021
1 parent 2ab0f33 commit 3bf594e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
accessing
ruleBodyOn: state

cachedRuleBodyGrammar ~= state
cachedRuleBodyParseId ~= state idOfParseProcess
ifTrue: [cachedRuleBody := nil].
cachedRuleBody ifNil: [
cachedRuleBody := (state grammar ruleNamed: ruleName asSymbol)
replaceParametersWithArguments: self arguments.
cachedRuleBodyGrammar := state.].
cachedRuleBodyParseId := state idOfParseProcess.].
^ cachedRuleBody
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"innerNodesAt:" : "pre 7/20/2015 14:39",
"nodesResultingInCST" : "pre 6/1/2015 14:48",
"replaceParametersWithArguments:" : "pre 11/17/2017 20:48",
"ruleBodyOn:" : "pre 7/26/2019 10:26",
"ruleBodyOn:" : "pre 5/4/2021 17:16",
"ruleName" : "pre 12/3/2014 16:53",
"ruleName:" : "pre 12/3/2014 16:53",
"toRecipe" : "pre 11/17/2017 20:20" } }
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"ruleName",
"arguments",
"cachedRuleBody",
"cachedRuleBodyGrammar",
"cachedRuleBodyParseId" ],
"name" : "OhmPExprApply",
"pools" : [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
idOfParseProcess

^ idOfParseProcess ifNil: [self]
^ idOfParseProcess ifNil: [idOfParseProcess := Object new]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cachedSpacesRule" : "pre 6/3/2019 17:02",
"grammar" : "pre 1/13/2015 10:40",
"grammar:" : "pre 1/13/2015 10:40",
"idOfParseProcess" : "pre 6/4/2019 18:21",
"idOfParseProcess" : "pre 5/4/2021 17:15",
"idOfParseProcess:" : "pre 6/4/2019 18:07",
"initialize" : "pre 1/21/2015 10:31",
"inputStream" : "pre 1/13/2015 12:35",
Expand Down

0 comments on commit 3bf594e

Please sign in to comment.