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

Compiler: Don't allow string as symbol so it doesn't restrict characters #207

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

jefft0
Copy link
Collaborator

@jefft0 jefft0 commented Jan 19, 2022

In Replicode, here is a statement to print "start: Inject fact":

(prb [1 "print" "start: Inject fact" |[]])

However, the compiler prints the confusing message "error: no variables allowed outside a pattern skeleton". This is because it treats "start as a symbol which is followed by : and so it thinks it is a variable. The problem comes from symbol_expr which checks if a sequence of characters is a symbol.

This pull request updates symbol_expr to exclude " as a symbol character. Therefore the start of the string is not a symbol and not treated as a variable. Now the message is printed as expected.

@jefft0 jefft0 changed the base branch from dev to master January 21, 2022 12:13
@jefft0 jefft0 added the bug Something isn't working label Jan 21, 2022
@jefft0 jefft0 changed the base branch from master to dev January 21, 2022 12:14
@jefft0 jefft0 changed the base branch from dev to master January 21, 2022 12:14
@jefft0 jefft0 force-pushed the symbol_expr-quote branch from e19952e to b315fd3 Compare January 21, 2022 12:16
@jefft0 jefft0 merged commit 36fa213 into master Jan 21, 2022
@jefft0 jefft0 deleted the symbol_expr-quote branch January 21, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant