Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eodermdrome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def usage(prog):
def run(fname, debug):
p = parse(fname)
p.render = debug
p.run("".join(stdin))
p.run("".join(stdin.read()) if any([cmd.input for cmd in p.commands]) else None)

def main():
if len(argv) < 2:
Expand Down
8 changes: 6 additions & 2 deletions eodermdrome/parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pyparsing import Suppress, Optional, CharsNotIn, Word, \
QuotedString, ZeroOrMore, stringEnd
QuotedString, OneOrMore, ZeroOrMore, stringEnd, \
Combine, White
from eodermdrome.program import Command, Program

def parse(path):
Expand All @@ -10,7 +12,9 @@ def parse(path):

# Graph characters and construction
graphchars = "abcdefghijklmnopqrstuvwxyz"
graph = Word(graphchars)
punctchars = ".!?¡¿;:[]{}-_‹›«»'\""
punctuated_whitespace = ZeroOrMore(Optional(White()) + Word(punctchars) + Optional(White()))
graph = Combine(OneOrMore(Word(graphchars) + Optional(Suppress(punctuated_whitespace))))

# Input and output text
text = QuotedString("(", endQuoteChar = ")", multiline = True)
Expand Down
1 change: 1 addition & 0 deletions samples/hello-world.eo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this (Hello, World!) says... hi!