add spaceless things
This commit is contained in:
parent
d5de7a480b
commit
173598d055
11
Makefile
11
Makefile
@ -12,13 +12,20 @@ all:
|
||||
@echo " - r"
|
||||
@echo ""
|
||||
|
||||
venv:
|
||||
ifeq (,$(findstring hy,$(VIRTUAL_ENV)))
|
||||
@echo "You're not in a Hy virtualenv. FOR SHAME"
|
||||
exit 1
|
||||
else
|
||||
@echo "We're properly in a virtualenv. Going ahead."
|
||||
endif
|
||||
|
||||
dev: test flake
|
||||
|
||||
test:
|
||||
test: venv
|
||||
nosetests -sv
|
||||
|
||||
tox:
|
||||
tox: venv
|
||||
tox
|
||||
|
||||
flake:
|
||||
|
@ -119,18 +119,22 @@ class ListeyThing(State):
|
||||
|
||||
def process(self, char):
|
||||
if char == "(":
|
||||
self.commit()
|
||||
self.machine.sub(Expression)
|
||||
return
|
||||
|
||||
if char == "{":
|
||||
self.commit()
|
||||
self.machine.sub(Dict)
|
||||
return
|
||||
|
||||
if char == "[":
|
||||
self.commit()
|
||||
self.machine.sub(List)
|
||||
return
|
||||
|
||||
if char == "\"":
|
||||
self.commit()
|
||||
self.machine.sub(String)
|
||||
return
|
||||
|
||||
|
@ -118,10 +118,28 @@ def test_lex_line_counting_multi_inner():
|
||||
assert inner.start_column == 5
|
||||
|
||||
|
||||
def tgest_dicts():
|
||||
def test_dicts():
|
||||
""" Ensure that we can tokenize a dict. """
|
||||
objs = tokenize("{foo bar bar baz}")
|
||||
assert objs == [HyDict({
|
||||
"foo": "bar",
|
||||
"bar": "baz"
|
||||
})]
|
||||
|
||||
|
||||
def test_nospace():
|
||||
""" Ensure we can tokenize without spaces if we have to """
|
||||
entry = tokenize("(foo(one two))")[0]
|
||||
|
||||
assert entry.start_line == 1
|
||||
assert entry.start_column == 1
|
||||
|
||||
assert entry.end_line == 1
|
||||
assert entry.end_column == 14
|
||||
|
||||
entry = entry[1]
|
||||
assert entry.start_line == 1
|
||||
assert entry.start_column == 5
|
||||
|
||||
assert entry.end_line == 1
|
||||
assert entry.end_column == 13
|
||||
|
Loading…
x
Reference in New Issue
Block a user