Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmatched \" quote defined key word STRING_QUOTE. May has potentially parsing error.s. #14

Open
Davidlihuang opened this issue Mar 10, 2023 · 0 comments

Comments

@Davidlihuang
Copy link

Davidlihuang commented Mar 10, 2023

-----.dsn------------------------------------------------------------------------------
(string_quote ")
(space_in_quoted_tokens on)
(host_cad "KiCad's Pcbnew")

---result below ------------------------------------------------------------------------
pcb
D:\pdavies\Documents\KiCad\wetroom-shield\wetroom-shield.dsn
parser
string_quote
)
(space_in_quoted_tokens on)
(host_cad
KiCad's
Pcbnew"
host_version
(2013-07-07 BZR 4022)-stable

--- fixed ----------------------------------------------------------------------
pcb
D:\pdavies\Documents\KiCad\wetroom-shield\wetroom-shield.dsn
parser
string_quote
"
space_in_quoted_tokens
on
host_cad
KiCad's Pcbnew
host_version
(2013-07-07 BZR 4022)-stable
----solution-------------------------------------------------------------------
It is better to treat the value of string_quote as a string identifier. Of course, we can also use a temporary solution to check whether the current node is a string_quote when encountering ("), and not treat it as a string.

-- code ----------------------------------------------------------------------
c_pcb_dsn.cpp:read_tree

if (b == '"')
		{
			if(nodeName != "string_quote")
			{
				in.get(c);
				t.m_branches.push_back(read_quoted_string(in));
				in.get(c);
				continue;
			}
			else
			{
				in.get(c);
				std::string str;
				str.push_back(b);
				t.m_branches.push_back(tree{str, {}});

				continue;
			}
		}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant