Skip to content

Commit 589a018

Browse files
committed
Regenerate grammar with the latest antlr
1 parent 1882a10 commit 589a018

5 files changed

Lines changed: 15 additions & 28 deletions

File tree

tempren/primitives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def absolute_path(self) -> Path:
2424
def __init__(self, input_directory: Path, relative_path: Path):
2525
assert input_directory.is_absolute()
2626
assert not relative_path.is_absolute()
27-
self.input_directory = input_directory
27+
self.input_directory = input_directory.resolve()
2828
self.relative_path = relative_path
2929

3030
def __str__(self):

tempren/template/grammar/TagTemplateLexer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated from TagTemplateLexer.g4 by ANTLR 4.10.1
1+
# Generated from TagTemplateLexer.g4 by ANTLR 4.13.1
22
import sys
33
from io import StringIO
44

@@ -1645,7 +1645,7 @@ class TagTemplateLexer(Lexer):
16451645

16461646
def __init__(self, input=None, output: TextIO = sys.stdout):
16471647
super().__init__(input, output)
1648-
self.checkVersion("4.10.1")
1648+
self.checkVersion("4.13.1")
16491649
self._interp = LexerATNSimulator(
16501650
self, self.atn, self.decisionsToDFA, PredictionContextCache()
16511651
)

tempren/template/grammar/TagTemplateParser.py

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated from TagTemplateParser.g4 by ANTLR 4.10.1
1+
# Generated from TagTemplateParser.g4 by ANTLR 4.13.1
22
# encoding: utf-8
33
import sys
44
from io import StringIO
@@ -1255,7 +1255,7 @@ class TagTemplateParser(Parser):
12551255

12561256
def __init__(self, input: TokenStream, output: TextIO = sys.stdout):
12571257
super().__init__(input, output)
1258-
self.checkVersion("4.10.1")
1258+
self.checkVersion("4.13.1")
12591259
self._interp = ParserATNSimulator(
12601260
self, self.atn, self.decisionsToDFA, self.sharedContextCache
12611261
)
@@ -1378,7 +1378,7 @@ def tag(self):
13781378
self.state = 30
13791379
self._errHandler.sync(self)
13801380
_la = self._input.LA(1)
1381-
if _la == TagTemplateParser.CONTEXT_START:
1381+
if _la == 5:
13821382
self.state = 26
13831383
self.match(TagTemplateParser.CONTEXT_START)
13841384
self.state = 27
@@ -1442,7 +1442,7 @@ def tag(self):
14421442
self.state = 51
14431443
self._errHandler.sync(self)
14441444
_la = self._input.LA(1)
1445-
if _la == TagTemplateParser.ARGS_START:
1445+
if _la == 9:
14461446
self.state = 50
14471447
self.argumentList()
14481448

@@ -1621,11 +1621,11 @@ def pattern(self):
16211621
self.state = 80
16221622
self._errHandler.sync(self)
16231623
token = self._input.LA(1)
1624-
if token in [TagTemplateParser.TEXT]:
1624+
if token in [4]:
16251625
self.state = 78
16261626
self.rawText()
16271627
pass
1628-
elif token in [TagTemplateParser.TAG_START]:
1628+
elif token in [2]:
16291629
self.state = 79
16301630
self.tag()
16311631
pass
@@ -1713,7 +1713,7 @@ def argumentList(self):
17131713
self.state = 96
17141714
self._errHandler.sync(self)
17151715
_la = self._input.LA(1)
1716-
while _la == TagTemplateParser.ARG_SEPARATOR:
1716+
while _la == 14:
17171717
self.state = 92
17181718
self.match(TagTemplateParser.ARG_SEPARATOR)
17191719
self.state = 93
@@ -1745,7 +1745,7 @@ def argumentList(self):
17451745
self.state = 108
17461746
self._errHandler.sync(self)
17471747
_la = self._input.LA(1)
1748-
while _la == TagTemplateParser.ARG_SEPARATOR:
1748+
while _la == 14:
17491749
self.state = 104
17501750
self.match(TagTemplateParser.ARG_SEPARATOR)
17511751
self.state = 105
@@ -1863,20 +1863,7 @@ def argumentValue(self):
18631863
self.enterOuterAlt(localctx, 1)
18641864
self.state = 120
18651865
_la = self._input.LA(1)
1866-
if not (
1867-
(
1868-
((_la) & ~0x3F) == 0
1869-
and (
1870-
(1 << _la)
1871-
& (
1872-
(1 << TagTemplateParser.NUMERIC_VALUE)
1873-
| (1 << TagTemplateParser.BOOLEAN_VALUE)
1874-
| (1 << TagTemplateParser.STRING_VALUE)
1875-
)
1876-
)
1877-
!= 0
1878-
)
1879-
):
1866+
if not ((((_la) & ~0x3F) == 0 and ((1 << _la) & 229376) != 0)):
18801867
self._errHandler.recoverInline(self)
18811868
else:
18821869
self._errHandler.reportMatch(self)

tempren/template/grammar/TagTemplateParserVisitor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Generated from TagTemplateParser.g4 by ANTLR 4.10.1
1+
# Generated from TagTemplateParser.g4 by ANTLR 4.13.1
22
from antlr4 import *
33

4-
if __name__ is not None and "." in __name__:
4+
if "." in __name__:
55
from .TagTemplateParser import TagTemplateParser
66
else:
77
from TagTemplateParser import TagTemplateParser

tempren/template/grammar/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
function antlr4() {
3-
export CLASSPATH="/usr/local/lib/antlr-4.10.1-complete.jar:$CLASSPATH"
3+
export CLASSPATH="/usr/local/lib/antlr-4.13.1-complete.jar:$CLASSPATH"
44
java org.antlr.v4.Tool "$@"
55
}
66

0 commit comments

Comments
 (0)