Commit Graph

297 Commits

Author SHA1 Message Date
Carson McDonald 3e911a8e14 Add locals null checks 2015-05-22 10:42:50 -04:00
Yukihiro "Matz" Matsumoto b7049b3945 there may be expecting here-doc when we see terminating characters; fix #2780 2015-05-20 19:14:04 +09:00
cremno 7fe853c216 remove unused token declarations 2015-05-13 18:31:51 +02:00
cremno 3cd80a520a define YYDEBUG macro conditionally
The YYDEBUG macro enables parser debugging which
unnecessarily increases the executable size (9 to 10 KB).
Now it only will be defined when PARSER_DEBUG is too.
2015-05-04 16:53:50 +02:00
Yukihiro "Matz" Matsumoto 2fe556d9c0 push cmdarg_stack in lambda body; fix [ruby-bug#11107] 2015-04-30 15:21:01 +09:00
Yukihiro "Matz" Matsumoto 5d0c8a70e9 Merge pull request #2777 from cremno/fix-parser-locals-null-deref
parser: fix possible null dereferences
2015-04-30 12:17:47 +09:00
cremno c18212573c fix null dereference (ref: #2769)
parser_state->locals might be a null pointer.

Fixes (and other similiar invalid code):
def a; Proc.new do def x==x end end
2015-04-28 19:03:58 +02:00
cremno 8789a5d520 prevent accidental macro redefinition of strndup() 2015-04-28 17:51:34 +02:00
Yukihiro "Matz" Matsumoto b3b6fe3c07 parser_state->locals may be NULL on some error conditions; fix #2769 2015-04-27 00:52:53 +09:00
Yukihiro "Matz" Matsumoto 4eff93632f mrb_parser_dump() did not work with block arguments 2014-12-11 00:08:56 +09:00
Yukihiro "Matz" Matsumoto bce75e2746 should support recursive mlhs decomposition, e.g. (a,b),c = [1,2],3 2014-11-22 12:16:59 +09:00
Yukihiro "Matz" Matsumoto 5347fb923d Merge pull request #2621 from suzukaze/fix-parse_string
Replace int with mrb_bool in parse_string func
2014-10-28 23:26:23 +09:00
Jun Hiroe 832b529679 Replace int with mrb_bool in parse_string func 2014-10-28 00:11:34 +09:00
Jun Hiroe 9ca1745833 Replace int with mrb_bool in local_var_p func 2014-10-28 00:11:16 +09:00
Jun Hiroe 34175bf41f Refactor yylex func 2014-10-27 01:27:00 +09:00
Jun Hiroe 7bd2a8508e Refactor mrbc_context_new func 2014-10-27 00:29:00 +09:00
Yukihiro "Matz" Matsumoto 89e9df2681 fixed wandering filename problem 2014-09-08 01:20:43 +09:00
Yukihiro "Matz" Matsumoto 81c894a1c6 add some MRB_API to function prototypes 2014-09-05 00:54:51 +09:00
Yukihiro "Matz" Matsumoto dc3c91dfdc rename a local variable current_node -> nodetype; ref #2583 2014-09-04 08:33:18 +09:00
cremno 26bbc81e12 get rid of shadowing variables
Mostly by renaming the shadowing variable.
If a shadowing variable was deleted,
the shadowed one can be used instead.
2014-09-03 10:00:37 +02:00
Yukihiro "Matz" Matsumoto 3c4cd5428a allow no_optimize esp. for debugger 2014-08-29 15:09:14 +09:00
Tatsuhiko Kubo 5fa30aeaea Fix mismatches for MRB_API declarations. 2014-08-29 01:06:22 +09:00
Yukihiro "Matz" Matsumoto abd7cad4fd adjust node lineno of muiti line statements 2014-08-29 01:06:22 +09:00
Yukihiro "Matz" Matsumoto 4b546e2ca4 print lineno of dumping node 2014-08-29 01:06:22 +09:00
cremno bdf6ce34ce printf: cast variables to the expected type
%x expects unsigned int and %p expects void *

GCC emits a diagnostic about %p/void* in pedantic mode:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26542
2014-08-26 00:30:33 +02:00
Tatsuhiko Kubo 6961317fb3 Remove spaces in end-of-line. 2014-08-25 16:49:15 +09:00
Tatsuhiko Kubo ae306793f2 Use specified macro(NULL) instead of magic-number. 2014-08-20 04:34:03 +09:00
ksss 14767a5597 Not create local variables in scope_new 2014-06-25 05:52:07 +09:00
Yukihiro "Matz" Matsumoto faa3c52a8d Merge branch 'master' of github.com:mruby/mruby 2014-06-25 02:37:51 +09:00
Yukihiro "Matz" Matsumoto 9874aafbf0 Merge pull request #2333 from yui-knk/fix/dump
Fix to not print unnecessary comma.
2014-06-25 02:37:39 +09:00
Yukihiro "Matz" Matsumoto 5b590d977f revert #2344 because of #2395 2014-06-25 02:36:02 +09:00
Yukihiro "Matz" Matsumoto 45e04c996e clear local variables for the first execution of mrb_context_run(); close #2405 2014-06-21 18:24:26 +09:00
Yukihiro "Matz" Matsumoto 0042e586db Merge pull request #2344 from yui-knk/fix-locals
Change to always use locals->car->car.
2014-06-14 01:03:39 +09:00
Jose Narvaez 6b642637b3 Fixed dead assignment in 'parser.y' reported by 'clang-analyzer' 2014-06-13 12:11:28 +01:00
Jose Narvaez 1a8e0ba4e8 Fixed dead assignment in 'parser.y' reported by 'clang-analyzer' 2014-06-13 12:11:23 +01:00
Jose Narvaez a250050077 Fixed dead assignment in 'parser.y' reported by 'clang-analyzer' 2014-06-13 12:06:56 +01:00
Jose Narvaez 4027035cf4 Fixed dead assignment in 'parse.y' reported by 'clang-analyzer' 2014-06-13 09:37:07 +01:00
Yukihiro "Matz" Matsumoto d75b84016c do not ignore negative characters (e.g. EOF and partial EOF); fix #2361 fix #2369 2014-06-08 01:38:44 +09:00
Yukihiro "Matz" Matsumoto a13e8f5ee1 revert #2368 due to #2369 2014-06-08 00:48:59 +09:00
take_cheeze 7f870f601f Treat partial hook success '\n' to fix #2361 .
Now it will parse the #2361 code as:
```
module A
end
module B
end
```
instead of
```
module A
end module B
end
```
2014-06-06 21:29:42 +09:00
cremno 1a5841b4b1 use uppercase US-ASCII ctype macros 2014-06-05 21:00:47 +02:00
cremno f9f864d4dd don't (re-)define ascii_isspace and isascii
`ISSPACE` and `ISASCII` can be used instead.
2014-06-05 20:27:17 +02:00
cremno 69da21bcb4 ISSPACE evaluates its argument multiple times 2014-06-05 20:22:20 +02:00
yui-knk b56a47cc38 Fix indent. 2014-06-03 16:29:42 +09:00
yui-knk 490d946bca Remove space. 2014-06-03 16:29:42 +09:00
yui-knk b5ef16ba03 Change to always use locals->car->car.
When p->locals->car is not NULL and p->locals->car->car is NULL,
local_add_f dose not append sym to p->locals->car->car.
This commit change to append sym to p->locals->car->car.
This will close #2333.
2014-06-02 09:38:24 +09:00
yui-knk c131f69d21 Remove space. 2014-05-31 14:10:30 +09:00
yui-knk 536697f41e Fix to not print unnecessary comma.
When `n2->car` is 0 and `n2->cdd` is not 0,
unnecessary comma was printed before first local variables.
2014-05-31 14:00:30 +09:00
Yukihiro "Matz" Matsumoto 6bf1ee78c8 add internal function mrb_toplevel_run_keep() to keep stack contents; close #2326 2014-05-30 15:25:58 +09:00
yui-knk 5fd1eaec58 fix indent. 2014-05-27 08:48:12 +09:00