Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
3bbf66f9
Commit
3bbf66f9
authored
Nov 10, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cancel #1565 since it breaks mirb; instead add special treatment to heredocs
parent
7e64d7e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
include/mruby/compile.h
include/mruby/compile.h
+0
-1
src/parse.y
src/parse.y
+9
-8
No files found.
include/mruby/compile.h
View file @
3bbf66f9
...
...
@@ -113,7 +113,6 @@ struct mrb_parser_state {
char
const
*
filename
;
int
lineno
;
int
column
;
int
eof
;
enum
mrb_lex_state_enum
lstate
;
mrb_ast_node
*
lex_strterm
;
/* (type nest_level beg . end) */
...
...
src/parse.y
View file @
3bbf66f9
...
...
@@ -3333,19 +3333,13 @@ nextc(parser_state *p)
return c;
eof:
if (!p->eof) {
p->eof = TRUE;
return '\n';
}
if (!p->cxt) return -1;
else {
mrbc_context *cxt = p->cxt;
if (cxt->partial_hook(p) < 0) return -1;
p->eof = FALSE;
p->cxt = NULL;
c = nextc(p);
c = '\n';
p->lineno = 1;
p->cxt = cxt;
return c;
}
...
...
@@ -3873,6 +3867,9 @@ heredoc_identifier(parser_state *p)
return 0;
}
} else {
if (c == -1) {
return 0; /* missing here document identifier */
}
if (! identchar(c)) {
pushback(p, c);
if (indent) pushback(p, '-');
...
...
@@ -3936,7 +3933,10 @@ parser_yylex(parser_state *p)
case '\0': /* NUL */
case '\004': /* ^D */
case '\032': /* ^Z */
return 0;
case -1: /* end of script. */
if (p->heredocs_from_nextline)
goto maybe_heredoc;
return 0;
/* white spaces */
...
...
@@ -3949,6 +3949,7 @@ parser_yylex(parser_state *p)
skip(p, '\n');
/* fall through */
case '\n':
maybe_heredoc:
heredoc_treat_nextline(p);
switch (p->lstate) {
case EXPR_BEG:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment