diff --git a/hy/lex/machine.py b/hy/lex/machine.py index aebdd92..119ca97 100644 --- a/hy/lex/machine.py +++ b/hy/lex/machine.py @@ -19,7 +19,6 @@ # DEALINGS IN THE SOFTWARE. from hy.lex.states import Idle, LexException -from hy.models.quote import HyQuote class Machine(object): @@ -29,17 +28,12 @@ class Machine(object): """ __slots__ = ("submachine", "nodes", "state", "line", "column", - "start_line", "start_column", "modifier") - - modifiers = { - "`": HyQuote - } + "start_line", "start_column") def __init__(self, state, line, column): self.nodes = [] self.line = line self.column = column - self.modifier = None self.submachine = None self.state = None self.set_state(state) @@ -77,10 +71,6 @@ class Machine(object): result.start_line, result.end_line = (self.start_line, self.line) result.start_column, result.end_column = (self.start_column, self.column) - if self.modifier is not None: - result = self.modifier(result) - self.modifier = None - self.nodes.append(result) def process(self, buf): @@ -105,10 +95,6 @@ class Machine(object): self.state.nodes.append(nodes[0]) continue - if char in self.modifiers: - self.modifier = self.modifiers[char] - continue - new = self.state.process(char) if new: self.set_state(new) diff --git a/hy/models/quote.py b/hy/models/quote.py deleted file mode 100644 index 2612b93..0000000 --- a/hy/models/quote.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2012 Paul Tagliamonte -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -from hy.models import HyObject - - -class HyQuote(HyObject): - def __init__(self, obj): - self.obj = obj diff --git a/tests/lex/test_lex.py b/tests/lex/test_lex.py index 772a775..b20ef22 100644 --- a/tests/lex/test_lex.py +++ b/tests/lex/test_lex.py @@ -22,7 +22,6 @@ from hy.models.expression import HyExpression from hy.models.integer import HyInteger from hy.models.symbol import HySymbol from hy.models.string import HyString -from hy.models.quote import HyQuote from hy.models.dict import HyDict from hy.lex.states import LexException @@ -144,9 +143,3 @@ def test_nospace(): assert entry.end_line == 1 assert entry.end_column == 13 - - -def test_lex_quoted_form(): - objs = tokenize("`(foo 2)") - assert type(objs[0]) == HyQuote - assert type(objs[0].obj) == HyExpression