Skip to content

Commit 5ac6b37

Browse files
committed
fix locus grammar such that it works on py2 and non-macs
1 parent b0e596e commit 5ac6b37

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pyoma/browser/locus_parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
grammar = '''?locus : join | complement | complement_join | location
1818
join : "join" "(" (complement | location ) ("," (complement | location ))+ ")"
19-
complement : "complement" "(" location ")"
19+
complement : "complement(" location ")"
2020
complement_join : "complement" "(" "join" "(" location ("," location)+ ")" ")"
21-
location : pos [".." pos ] | "FromElsewhere" "('" _SEQID "'," pos [".." pos] ")"
21+
location : pos [ _RNG pos ] | "FromElsewhere" "('" _SEQID "'," pos [ _RNG pos ] ")"
2222
?pos : num | "Before" "(" num ")" | "After" "(" num ")"
23-
?num : NUMBER -> number
23+
?num : /[0-9]+/ -> number
2424
_SEQID: /[A-Za-z0-9._-]+/
25+
_RNG: ".."
26+
2527
2628
%import common.NUMBER
2729
%import common.WS

tests/browser/test_locusparser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import unicode_literals
22
import unittest
33
from pyoma.browser import locus_parser
4+
import logging
5+
logging.basicConfig(level=logging.DEBUG)
46

57

68
class LocusParserTest(unittest.TestCase):

0 commit comments

Comments
 (0)