summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/parse.y
AgeCommit message (Collapse)Author
2019-04-01Avoid keeping pointers from `mrb_sym2name_len()`; fix #4342Yukihiro "Matz" Matsumoto
The addresses for packed inline symbols reference `mrb->symbuf` that could be overridden by the later call of `mrb_sym2name_len`. Since file names in call stack information are kept as symbols, keeping the address in the C structures could cause problems like #4342. This changes small incompatible changes in function prototypes: * `mrb_parser_get_filename`: return value changed to `mrb_sym`. * `mrb_debug_get_filename`: add `mrb_state*` as a first argument. * `mrb_debug_get_line`: ditto. I believe above functions are almost internal, and no third-party mrbgem use them.
2019-03-25Use uppercase version of `ctype` macros e.g. `ISSPACE`; fix #4338Yukihiro "Matz" Matsumoto
2019-02-28Add `warning: ` prefix to parser warning messageKOBAYASHI Shuji
2019-02-28Merge pull request #4301 from shuujii/remove-unnecessary-backticksYukihiro "Matz" Matsumoto
Remove unnecessary backticks; ref #2858
2019-02-27Compositing `NODE_DSTR` and `NODE_DSTR`dearblue
2019-02-27Compositing `NODE_DSTR` and `NODE_STR`dearblue
2019-02-27Compositing `NODE_STR` and `NODE_DSTR`dearblue
2019-02-27Replacement to function for composite two string nodesdearblue
2019-02-27Replacement to function for `NODE_STR` chekingdearblue
2019-02-27Compositing `NODE_STR` and `NODE_STR`dearblue
2019-02-27Concatenate string literalsdearblue
2019-02-27Remove unnecessary backticks; ref #2858KOBAYASHI Shuji
2019-02-27Use `yywarning()` instead of `yywarning_s()` for `MRB_WITHOUT_FLOAT`KOBAYASHI Shuji
2019-02-07Add `OP_ENTER` to blocks without parameters; fix #4175Yukihiro "Matz" Matsumoto
So that `lambda{}.call(1)` raises `ArgumentError` as CRuby does. Also, fixed junk assignment for `lambda{|;a|p a}.call{}`.
2018-12-31Should not check non-node value to `void_expr_error`; fix #4203Yukihiro "Matz" Matsumoto
This is also a reason for #4192 as well.
2018-12-21Add `NULL` pointer check before `void_expr_error()`; fix #4192Yukihiro "Matz" Matsumoto
2018-11-25Allow destructuring in formal arguments.Yukihiro "Matz" Matsumoto
e.g. ``` def m(a,(b,c),d); p [a,b,c,d]; end m(1,[2,3],4) # => [1,2,3,4] ``` mruby limitation: Destructured arguments (`b` and `c` in above example) cannot be accessed from the default expression of optional arguments and keyword arguments, since actual assignment is done after the evaluation of those default expressions. Thus: ``` def f(a,(b,c),d=b) p [a,b,c,d] end f(1,[2,3]) ``` raises `NoMethodError` for `b` in mruby.
2018-11-25Remove redundant rules from `parse.y`.Yukihiro "Matz" Matsumoto
2018-11-20Fixed a bug in `mirb` heredoc handling; fix #3989Yukihiro "Matz" Matsumoto
2018-11-20Stop special treating of `\r` in the lexer; fix #4132Yukihiro "Matz" Matsumoto
2018-11-19Need to keep rooms for empty splat; fix #4166Yukihiro "Matz" Matsumoto
2018-11-15Fixed a bug in continuous read of target files; ref #4138Yukihiro "Matz" Matsumoto
Line number information in a compiled file was wrong.
2018-11-15Shrink file name table size to `uint16_t`; ref #4138Yukihiro "Matz" Matsumoto
2018-08-25Add `NODE_KW_HASH` support in `mrb_parser_dump()`.Yukihiro "Matz" Matsumoto
2018-08-25Remove `arg_value` from `parse.y`.Yukihiro "Matz" Matsumoto
2018-07-30Keyword argument implemented.Yukihiro "Matz" Matsumoto
2018-07-30New bytecode implementation of mruby VM.Yukihiro "Matz" Matsumoto
2018-02-12Resolve conflicts between labels and conditional ternary; fix #3931Yukihiro "Matz" Matsumoto
2018-02-10Need to determine `IS_LABEL_POSSIBLE()` properly.Yukihiro "Matz" Matsumoto
Otherwise, `{"a": 1}` will cause `SyntaxError`.
2018-01-16Allow `-> do rescue; end` as well as `proc do rescue; end` [Ruby2.6]Yukihiro "Matz" Matsumoto
2017-11-04Merge branch 'master' of github.com:mruby/mrubyYAMAMOTO Masaya
2017-10-28Heavily refactored how lexical scope links are implemented; fix #3821Yukihiro "Matz" Matsumoto
Instead of `irep` links, we added a `upper` link to `struct RProc`. To make a space for the `upper` link, we moved `target_class` reference. If a `Proc` does not have `env`, `target_class` is saved in an `union` shared with `env` (if a `Proc` has env, you can tell it by `MRB_PROC_ENV_P()). Otherwise `target_class` is referenced from `env->c`. We removed links in `env` as well. This change removes 2 members from `mrb_irep` struct, thus saving 2 words per method/proc/block. This also fixes potential memory leaks due to the circular references caused by a link from `mrb_irep`.
2017-10-17`do/end` blocks to work with `rescue/ensure/else`; CRuby2.5Yukihiro "Matz" Matsumoto
2017-10-12Correct a small error in parse.y, which causes the reading of unassigned ↵Carlo Prelz
memory (triggers an error when address sanitizer is active)
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-10-09Fix parse error on TRICK2013/yharaNobuyoshi Nakada
2017-10-09Replace lvar_defined with local_var_pNobuyoshi Nakada
2017-09-27fix: mrbgems\mruby-compiler\core\parse.y(3455): warning C4244: 'function': ↵Tomasz Dąbrowski
conversion from 'intptr_t' to 'int', possible loss of data
2017-09-25The `[]` special method call should be able to take a block.Yukihiro "Matz" Matsumoto
2017-09-25The `lex_state` after literals should be `EXPR_ENDARG`.Yukihiro "Matz" Matsumoto
2017-09-25The symbols should not take brace blocks.Yukihiro "Matz" Matsumoto
2017-08-28Add `__ENCODING__' support.Yukihiro "Matz" Matsumoto
`__ENCODING__' returns the current encoding name (string), unlike CRuby that returns the encoding object.
2017-08-28Remove integer type mismatch warnings from parse.y.Yukihiro "Matz" Matsumoto
2017-08-22`c` (`mrbc_context`) may be NULL; fix #3787Yukihiro "Matz" Matsumoto
2017-08-11`scan_hex` may be used to parse both unicode and hex escape.Yukihiro "Matz" Matsumoto
The error checks for both usage should be separated; ref #3774
2017-08-11Fixed a wrong condition in `scan_hex`; fix #3774Yukihiro "Matz" Matsumoto
2017-08-09Replaced tabs with spacesChristopher Aue
2017-08-05Change return type of `scan_oct` from `int` to `int32_t`.Yukihiro "Matz" Matsumoto
2017-08-05Left shift of signed integers is undefined behavior in C; fix #3762Yukihiro "Matz" Matsumoto
2017-07-24Initialize potentially uninitialized local variable.Yukihiro "Matz" Matsumoto