summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core
AgeCommit message (Collapse)Author
2019-08-05Use new specifiers/modifiers of `mrb_vfromat()`KOBAYASHI Shuji
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in my environment than before the introduction of new specifiers/modifiers (5116789a) with this change. ------------+-------------------+-------------------+-------- BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO ------------+-------------------+-------------------+-------- mruby | 593416 bytes | 593208 bytes | -0.04% libmruby.a | 769048 bytes | 767264 bytes | -0.23% ------------+-------------------+-------------------+-------- BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613, so I put it back.
2019-07-27Fix line number bug; fix #4513Yukihiro "Matz" Matsumoto
Also fix the misfeature introduced in 23783a4, that ignores newlines between method chains.
2019-07-17Revert #4300KOBAYASHI Shuji
Originally, it was not necessary to change. I made mistake.
2019-07-15Unify type of line number to `uint16_t`KOBAYASHI Shuji
2019-06-17Support parsing a Regexp literal with 'o' optionRyan Lopopolo
CRuby supports a 'o' `Regexp` option for `Regexp` literals, e.g. `/foo/o` that disables multiple interpolation passes. This commit adds support for parsing such literals. Nothing is done with the option, it is consumed and ignored by the parser.
2019-06-17Fixed indentation in parse.yYukihiro "Matz" Matsumoto
2019-06-17Allow newlines and comments between method calls.Yukihiro "Matz" Matsumoto
2019-06-17Support `&.` at the beginning of the line.Yukihiro "Matz" Matsumoto
2019-06-17Fixed wrong behavior on `..` at the beginning of the line.Yukihiro "Matz" Matsumoto
2019-05-16Enable `YYSTACK_USE_ALLOCA`.Yukihiro "Matz" Matsumoto
It used heap allocated memory for the parser stack, but there's possibility of parser termination by exceptions. In that case, the parser stack memory is leaked. We were afraid of stack consumption, but parser stack size is only 4KB, so we don't have to worry about it (at least for the parser).
2019-05-15FixUkrainskiy Sergey
2019-05-15Small refactoringUkrainskiy Sergey
2019-05-15Initial suffix supportUkrainskiy Sergey
2019-05-03Clean duplicate codedearblue
Removed duplicates in the code entered for "Concatenate string literal".
2019-04-14Merge pull request #4376 from dearblue/leak-symbolsYukihiro "Matz" Matsumoto
Fix leaked function symbols
2019-04-14Fix leaked function symbolsdearblue
- `free_heap()` in src/gc.c - `symhash()` in src/symbol.c - `no_optimize()` in mrbgems/mruby-compiler/core/codegen.c
2019-04-14Fix string index for appendingdearblue
`sizeof(string-literal)` is included `'\0'` character
2019-04-14Fix hexdigits convertiondearblue
2019-04-12Deallocate `s->lines` in `codegen_error`; ref #4370Yukihiro "Matz" Matsumoto
2019-04-12The number of local variables should be less than 1024; fix #4370Yukihiro "Matz" Matsumoto
The `env` stores stack length in a 10 bit field. See `MRB_ENV_STACK_LEN()` macro.
2019-04-11Fix buffer overflows in parser.Clayton Smith
2019-04-10Rename `itoa` to `dump_int` to avoid name crash; ref #4173Yukihiro "Matz" Matsumoto
2019-04-08Avoid using `snprintf` when `MRB_DISABLE_STDIO` is set; fix #4173Yukihiro "Matz" Matsumoto
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-18Use key argument register for `OP_KEY_P` to reduce register use.Yukihiro "Matz" Matsumoto
2019-02-11Small refactoring in `codegen.c`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{}`.
2019-01-28`class`/`module` expression with empty body should return `nil`KOBAYASHI Shuji
Before: p(class A end) #=> A p(class << self; end) #=> #<Class:#<Object:0x7fdc3880e420>> p(module B end) #=> B After/Ruby: p(class A end) #=> nil p(class << self; end) #=> nil p(module B end) #=> nil
2019-01-06Fix 0.0 and -0.0 handling.KOBAYASHI Shuji
Fix the following issue: Good: $ bin/mruby -e 'p(-0.0)' #=> "-0" Bad: $ bin/mruby -e 'a=0.0; p(-0.0)' #=> "0"
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