mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 15:48:09 -05:00
parser: don't enforce variable naming convention (#761)
This commit is contained in:
parent
749f0fa750
commit
4fd6642be9
2 changed files with 2 additions and 7 deletions
|
@ -535,13 +535,6 @@ def read_line(self, line: str):
|
||||||
variable_name = get_synthetic_name(line)
|
variable_name = get_synthetic_name(line)
|
||||||
else:
|
else:
|
||||||
variable_name = get_variable_name(line)
|
variable_name = get_variable_name(line)
|
||||||
# This is out of our control for library variables, but all of our
|
|
||||||
# variables should start with "g_".
|
|
||||||
if variable_name is not None:
|
|
||||||
# Before checking for the prefix, remove the
|
|
||||||
# namespace chain if there is one.
|
|
||||||
if not variable_name.split("::")[-1].startswith("g_"):
|
|
||||||
self._syntax_warning(ParserError.GLOBAL_MISSING_PREFIX)
|
|
||||||
|
|
||||||
string_name = get_string_contents(line)
|
string_name = get_string_contents(line)
|
||||||
|
|
||||||
|
|
|
@ -377,6 +377,7 @@ def test_unexpected_eof(parser):
|
||||||
assert parser.alerts[0].code == ParserError.UNEXPECTED_END_OF_FILE
|
assert parser.alerts[0].code == ParserError.UNEXPECTED_END_OF_FILE
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="no longer applies")
|
||||||
def test_global_variable_prefix(parser):
|
def test_global_variable_prefix(parser):
|
||||||
"""Global and static variables should have the g_ prefix."""
|
"""Global and static variables should have the g_ prefix."""
|
||||||
parser.read_lines(
|
parser.read_lines(
|
||||||
|
@ -576,6 +577,7 @@ def test_namespace_vtable(parser):
|
||||||
assert parser.vtables[1].name == "Hello"
|
assert parser.vtables[1].name == "Hello"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="no longer applies")
|
||||||
def test_global_prefix_namespace(parser):
|
def test_global_prefix_namespace(parser):
|
||||||
"""Should correctly identify namespaces before checking for the g_ prefix"""
|
"""Should correctly identify namespaces before checking for the g_ prefix"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue