diff --git a/packages/Ohm-Core.package/OhmNode.class/instance/firstChild.st b/packages/Ohm-Core.package/OhmNode.class/instance/firstChild.st new file mode 100644 index 0000000..2d4f65a --- /dev/null +++ b/packages/Ohm-Core.package/OhmNode.class/instance/firstChild.st @@ -0,0 +1,4 @@ +accessing +firstChild + + ^ self children first \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmNode.class/instance/isEmpty.st b/packages/Ohm-Core.package/OhmNode.class/instance/isEmpty.st new file mode 100644 index 0000000..a48d011 --- /dev/null +++ b/packages/Ohm-Core.package/OhmNode.class/instance/isEmpty.st @@ -0,0 +1,6 @@ +testing +isEmpty + + ^ (self interval length == 0 + or: [ self interval end < 1 ] + or: [ self interval start > self interval stream contents size ]) \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmNode.class/instance/isNotEmpty.st b/packages/Ohm-Core.package/OhmNode.class/instance/isNotEmpty.st new file mode 100644 index 0000000..3af20c8 --- /dev/null +++ b/packages/Ohm-Core.package/OhmNode.class/instance/isNotEmpty.st @@ -0,0 +1,4 @@ +testing +isNotEmpty + + ^ self isEmpty not \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmNode.class/instance/numberOfChildren.st b/packages/Ohm-Core.package/OhmNode.class/instance/numberOfChildren.st new file mode 100644 index 0000000..0136af1 --- /dev/null +++ b/packages/Ohm-Core.package/OhmNode.class/instance/numberOfChildren.st @@ -0,0 +1,4 @@ +accessing +numberOfChildren + + ^ self children size \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmNode.class/instance/unformattedSourceCode.st b/packages/Ohm-Core.package/OhmNode.class/instance/unformattedSourceCode.st new file mode 100644 index 0000000..0fa1c3e --- /dev/null +++ b/packages/Ohm-Core.package/OhmNode.class/instance/unformattedSourceCode.st @@ -0,0 +1,4 @@ +accessing +unformattedSourceCode + + ^ self interval stream contents \ 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 e1f4eb8..09e679f 100644 --- a/packages/Ohm-Core.package/OhmNode.class/methodProperties.json +++ b/packages/Ohm-Core.package/OhmNode.class/methodProperties.json @@ -7,14 +7,18 @@ "children" : "pre 1/5/2015 16:06", "children:" : "pre 1/5/2015 16:06", "enclosingRule" : "pre 7/31/2020 15:43", + "firstChild" : "PS 8/1/2020 09:25", "grammar" : "pre 1/5/2015 15:38", "grammar:" : "pre 1/5/2015 15:38", "initialize" : "pre 11/21/2017 15:29", "interval" : "pre 1/5/2015 15:38", "interval:" : "pre 1/5/2015 15:38", + "isEmpty" : "fau 7/31/2020 16:31", "isListNode" : "pre 3/2/2018 16:08", + "isNotEmpty" : "fau 7/31/2020 16:32", "isRootNode" : "pre 7/13/2020 10:31", "isTerminalNode" : "pre 3/2/2018 16:17", + "numberOfChildren" : "fau 8/4/2020 09:03", "parent" : "pre 1/21/2015 15:03", "parent:" : "pre 1/21/2015 15:03", "printStringLimitedTo:" : "pre 6/9/2015 13:39", @@ -23,4 +27,5 @@ "ruleName:" : "pre 1/6/2015 17:15", "skippedSpacesNodes" : "pre 7/10/2020 11:17", "skippedSpacesString" : "pre 7/31/2020 15:47", - "sourceMap" : "pre 7/13/2020 10:32" } } + "sourceMap" : "pre 7/13/2020 10:32", + "unformattedSourceCode" : "PS 8/4/2020 06:24" } } diff --git a/packages/Ohm-Core.package/OhmSourceMapping.class/instance/defaultExpression..st b/packages/Ohm-Core.package/OhmSourceMapping.class/instance/defaultExpression..st index 715af15..cc815ee 100644 --- a/packages/Ohm-Core.package/OhmSourceMapping.class/instance/defaultExpression..st +++ b/packages/Ohm-Core.package/OhmSourceMapping.class/instance/defaultExpression..st @@ -1,7 +1,8 @@ standard attributes defaultExpression: aNode - (aNode interval start to: (aNode interval end min: self sourceMap size)) - do: [:index | (self sourceMap at: index) add: aNode]. - - aNode children do: [:c | self value: c]. \ No newline at end of file + aNode isNotEmpty ifTrue: [ + aNode interval start + to: aNode interval end + do: [ :index | (self sourceMap at: index) add: aNode ]. + aNode children do: [ :c | self value: c ] ] \ No newline at end of file diff --git a/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st b/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st index b5f178c..3a15c1e 100644 --- a/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st +++ b/packages/Ohm-Core.package/OhmSourceMapping.class/instance/terminalExpression..st @@ -1,5 +1,7 @@ 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 isNotEmpty ifTrue: [ + aNode interval start + to: aNode interval end + do: [ :index | (self sourceMap at: index) 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 c13f692..70b8f0c 100644 --- a/packages/Ohm-Core.package/OhmSourceMapping.class/methodProperties.json +++ b/packages/Ohm-Core.package/OhmSourceMapping.class/methodProperties.json @@ -3,7 +3,7 @@ }, "instance" : { "createSourceMapFor:" : "pre 7/31/2020 15:20", - "defaultExpression:" : "pre 7/13/2020 11:02", + "defaultExpression:" : "fau 7/31/2020 17:35", "sourceMap" : "pre 4/29/2020 10:20", "sourceMap:" : "pre 4/29/2020 10:20", - "terminalExpression:" : "pre 7/13/2020 11:01" } } + "terminalExpression:" : "fau 7/31/2020 17:38" } } diff --git a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/class/serializedGrammar.st b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/class/serializedGrammar.st index 2aa66f4..71d22b4 100644 --- a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/class/serializedGrammar.st +++ b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/class/serializedGrammar.st @@ -36,7 +36,7 @@ Expression = Operand CascadedMessages -- operandCascade | UnaryMessageReceiver CascadedMessages -- unaryCascade | BinaryMessageReceiver CascadedMessages -- binaryCascade - | KeywordMessageSend + | KeywordMessageSend --base BinaryMessageSend = BinaryMessageReceiver BinaryMessage? @@ -143,7 +143,8 @@ Pragma = "<" PragmaValues ">" PragmaValues = - KeywordPragma+ | unaryPragma + KeywordPragma+ --keyword + | unaryPragma --unary Pragmas = Pragma* diff --git a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/methodProperties.json b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/methodProperties.json index 38df315..80ab114 100644 --- a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/methodProperties.json +++ b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalk.class/methodProperties.json @@ -1,5 +1,5 @@ { "class" : { - "serializedGrammar" : "pre 7/7/2020 16:08" }, + "serializedGrammar" : "fau 7/29/2020 16:41" }, "instance" : { } } diff --git a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesConstantReferencesInExpressions.st b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesConstantReferencesInExpressions.st index d21dced..195f3a3 100644 --- a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesConstantReferencesInExpressions.st +++ b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesConstantReferencesInExpressions.st @@ -3,9 +3,10 @@ testGrammarParsesConstantReferencesInExpressions startRule := #Expression. self shouldParse: 'nil+3' to: #(Expression - (KeywordMessageSend - (KeywordMessageReceiver - (BinaryMessageSend - (BinaryMessageReceiver (UnaryMessageSend (UnaryMessageSend_base (Operand (Literal 'nil'))))) - (BinaryMessage '+3'))) - (_list))) \ No newline at end of file + (Expression_base + (KeywordMessageSend + (KeywordMessageReceiver + (BinaryMessageSend + (BinaryMessageReceiver (UnaryMessageSend (UnaryMessageSend_base (Operand (Literal 'nil'))))) + (BinaryMessage '+3'))) + (_list)))) \ No newline at end of file diff --git a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesUnaryMessageSendsWithProblematicOperand.st b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesUnaryMessageSendsWithProblematicOperand.st index 8b1bcf6..03d881d 100644 --- a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesUnaryMessageSendsWithProblematicOperand.st +++ b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/instance/testGrammarParsesUnaryMessageSendsWithProblematicOperand.st @@ -4,23 +4,25 @@ testGrammarParsesUnaryMessageSendsWithProblematicOperand startRule := #Expression. self shouldParse: '2negated' to: #(Expression - #(KeywordMessageSend - #(KeywordMessageReceiver - #(BinaryMessageSend - #(BinaryMessageReceiver - #(UnaryMessageSend - #(UnaryMessageSend_message - #(UnaryMessageReceiver #(Operand '2')) - #(UnaryMessage 'negated')))))) - #(_list))); + #(Expression_base + #(KeywordMessageSend + #(KeywordMessageReceiver + #(BinaryMessageSend + #(BinaryMessageReceiver + #(UnaryMessageSend + #(UnaryMessageSend_message + #(UnaryMessageReceiver #(Operand '2')) + #(UnaryMessage 'negated')))))) + #(_list)))); shouldParse: 'falseNegated' to: #(Expression - #(KeywordMessageSend - #(KeywordMessageReceiver - #(BinaryMessageSend - #(BinaryMessageReceiver - #(UnaryMessageSend - #(UnaryMessageSend_base - #(Operand 'falseNegated')))))) - #(_list))) + #(Expression_base + #(KeywordMessageSend + #(KeywordMessageReceiver + #(BinaryMessageSend + #(BinaryMessageReceiver + #(UnaryMessageSend + #(UnaryMessageSend_base + #(Operand 'falseNegated')))))) + #(_list)))) \ No newline at end of file diff --git a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/methodProperties.json b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/methodProperties.json index 0e40d4a..c7999c8 100644 --- a/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/methodProperties.json +++ b/packages/Ohm-Grammars.package/OhmExplicitSendsSmalltalkGrammarTest.class/methodProperties.json @@ -7,6 +7,6 @@ "testGrammarDistinguishesOperandAndUnaryCascades" : "pre 7/28/2020 16:13", "testGrammarParsesBinaryMessageChains" : "pre 7/6/2020 12:28", "testGrammarParsesCascadedMessages" : "pre 7/10/2020 13:53", - "testGrammarParsesConstantReferencesInExpressions" : "pre 7/6/2020 15:23", + "testGrammarParsesConstantReferencesInExpressions" : "fau 7/30/2020 14:51", "testGrammarParsesUnaryMessageChains" : "pre 7/6/2020 12:28", - "testGrammarParsesUnaryMessageSendsWithProblematicOperand" : "pre 6/10/2020 18:14" } } + "testGrammarParsesUnaryMessageSendsWithProblematicOperand" : "fau 7/30/2020 14:50" } }