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

How to handle bare candidate tokens without a mapping when other bare tokens have a mapping? #12

Open
simberaj opened this issue Jun 18, 2021 · 2 comments

Comments

@simberaj
Copy link

Consider this ABIF file

[Joe Biden]: JB
[Donald Trump]: DT

125: JB>DT
113: DT>JB
110: JB>DT>JS

What should the parser do when encountering JS?

@robla
Copy link
Contributor

robla commented Jun 18, 2021

Interesting test case! I think the ABIF implementation can just assume that "JS" is an unnamed candidate, and have implementation-specific behavior. For some implementations, the parser could emit a warning:

WARNING (line 6, bundle 3): undefined bare token "JS" in ballot bundle "110: JB>DT>JS"

Other implementations could insist on having the candidate names defined at the top of the file. Still others could ignore the fact that JS isn't declared yet, and assume the candidate's name is "JS" in the final report that it emits. From a parser perspective, "JS" is a valid bare token ("[A-Z][a-z]*") so parser implementations should treat "JS" as valid before handing off the parsed line to the rest of the implementation.

@simberaj
Copy link
Author

Sounds good to me.

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

2 participants