diff options
author | Mu Qiao <qiaomuf@gentoo.org> | 2011-07-24 12:10:23 +0800 |
---|---|---|
committer | Mu Qiao <qiaomuf@gentoo.org> | 2011-08-02 15:52:18 +0800 |
commit | 3ad149db6ddfb44c6e39777381c9527d2c7e2e0d (patch) | |
tree | bae469922aced4ccbdd3404da50888b0d5c96054 /bashast/bashast.g | |
parent | Parser: fix single quoted string in command sub (diff) | |
download | libbash-3ad149db6ddfb44c6e39777381c9527d2c7e2e0d.tar.gz libbash-3ad149db6ddfb44c6e39777381c9527d2c7e2e0d.tar.bz2 libbash-3ad149db6ddfb44c6e39777381c9527d2c7e2e0d.zip |
Parser: fix here document start
The solution is not ideal but we can not generate metadata without it.
We can improve it in future when we have better approach.
Diffstat (limited to 'bashast/bashast.g')
-rw-r--r-- | bashast/bashast.g | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g index c987375..9c248e4 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -309,8 +309,11 @@ here_document_begin : ( token=~(EOL|BLANK|LESS_THAN|HERE_STRING_OP|AMP|GREATER_THAN|RSHIFT) { - $here_document::here_document_word += get_string($token); - $here_document::number_of_tokens++; + if(LA(-1) != DQUOTE && LA(-1) != ESC) + { + $here_document::here_document_word += get_string($token); + $here_document::number_of_tokens++; + } } )+; here_document_end |