package morbig
Module Morbig.PrelexerStateSource
type atom = | WordComponent of string * CST.word_component| QuotingMark of quote_kind| AssignmentMark
push_word_closing_character b c push a character c to mark it as part of the string representing the current word literal but with no interpretation as a word CSTs. Typically, if the word is "$(1)", the string representing the current word is "$(1)" so the character ')' must be pushed as part of this string representation but ')' is already taken care of in the word CST WordSubshell (_, _) associated to this word so we do not push ')' as a WordLiteral CST.
val push_parameter :
?with_braces:??? ->
?attribute:??? ->
prelexer_state ->
string ->
prelexer_state(return ?with_newline lexbuf current tokens) returns a list of pretokens consisting of, in that order:
- WORD(w), where w is the contents of the buffer
currentin case the buffercurrentis non-empty;
- all the elements of
tokens;
- NEWLINE, in case ?with_newline is true (default: false).
We know that tokens does not contain any Word pretokens. In fact, the prelexer produces Word pretokens only from contents he has collected in the buffer.
val return :
?with_newline:??? ->
Lexing.lexbuf ->
prelexer_state ->
Pretoken.t list ->
(Pretoken.t * Lexing.position * Lexing.position) listval provoke_error :
prelexer_state ->
Lexing.lexbuf ->
(Pretoken.t * Lexing.position * Lexing.position) listval escape_analysis :
?for_backquote:??? ->
?for_dquotes:??? ->
Nesting.t list ->
prelexer_state ->
int optionA double quote can be escaped if we are already inside (at least) two levels of quotation. For instance, if the input is <dquote> <dquote> <backslash><backslash> <dquote> <dquote> <dquote>, the escaped backslash is used to escape the quote character.
val escape_analysis_predicate :
?for_backquote:??? ->
?for_dquotes:??? ->
Nesting.t list ->
prelexer_state ->
boolval remove_contents_suffix :
Lexing.position ->
string ->
string ->
CST.word_component list ->
string * CST.word_component list