Repository navigation
Conversation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A
ValueSymbolprints its value as CCL. Concourse'sCriteria.ccl()is built from that text, and RestQL's canonical query string is the CCL that ccl prints for aCriteria(cinchapi/restql#51). A string value printed without quotes unless it held a space or=. So a string that CCL reads as syntax, such asa),[a],a;b, a tab, a line break,$id$,andorwhere, printed as text that did not parse or that parsed as another value. A string within quotes, such as'a', printed as is and parsed back asa. A quoted string with a backslash before a double quote or at its end parsed back with a backslash lost or added.The CCL grammar decides whether a string can print unquoted: the lexer must read the text as one unquoted value token that spans it. Asking the lexer keeps the rule in step with the grammar, including every reserved word and operator, without a list of characters or words to maintain. Within quotes, the lexer reads a backslash as an escape for the next character, and the parser reads
\"as". So a string that holds both quote characters prints within double quotes, with\"for each double quote inside.Part of #79. This change covers the value side of #79. The key side remains open. A
KeySymbolwhose key is a word that starts or joins a condition still prints as text that does not parse. Such words arewhere,and,or, the operator words such aseqandlike,at,on,during,ascanddesc. The grammar has no quoted form for a key, and #85 made only command, preposition and page words parse as keys.Behavior
jeff,a.b,a*orjeff@cinchapi.com.$or\$and that the lexer reads as one unquoted value prints unquoted, as a local reference or its escape.Compiler#parse(String, Multimap)resolves that text the wayCompiler#parse(List, Multimap)resolves the symbol.it's "x"prints as"it's \"x\"", andC:\Program Files\prints as"C:\Program Files\\".it's \\, prints within double quotes, and its text does not parse back as the string.trueas a boolean,@1as a link and|now|as a timestamp. Such a string prints unquoted and reads back as that type.