Commit Graph

221 Commits

Author SHA1 Message Date
take_cheeze 52cf39a67a remove deprecated register keyword 2014-03-11 22:01:00 +09:00
cubicdaiya 019d15c3ee Use mrb_exc_new_str_lit widely 2014-03-04 02:45:53 +09:00
Yukihiro "Matz" Matsumoto 7721463a35 add const to char* to pacify warnings for string litral to char* conversion 2014-03-02 00:59:12 +09:00
take_cheeze 78915f9601 support c++ exception 2014-03-01 20:05:29 +09:00
cubicdaiya 67de10bfcb use C style comments instead of C++ style comments
According to CONTRIBUTING.md,

Don't use C++ style comments

 /* This is the prefered comment style */

Use C++ style comments only for temporary comment e.g. commenting out some code lines.
2014-03-01 03:31:45 +09:00
cremno 4507985c3e use mrb_bool, FALSE and TRUE more
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0
but I prefer a type (alias) which emphasizes boolean vars to int.
I changed 1/0 to FALSE/TRUE anyway.
2014-01-31 18:00:36 +01:00
Yukihiro "Matz" Matsumoto 7c9a1accff remove conflict 2014-01-31 17:09:04 +09:00
h2so5 650ffb9d84 reindent parse.y 2014-01-31 11:30:58 +09:00
cremno f2a62a74ed clean up external symbols
remove unused and unneeded:
- sysexit_status
- type (a global variable)

add mrb_ prefix to:
- codedump_all
- class_instance_method_list
- parser_dump

make various functions static, incl.:
- yyparse
- make_exception
2014-01-31 01:30:18 +01:00
Yukihiro "Matz" Matsumoto a68a517028 refactor parser lineno adjustment; ref #1667 2014-01-31 00:49:46 +09:00
Yukihiro "Matz" Matsumoto dd70ae0b6e add semicolon after the statements 2014-01-30 22:08:31 +09:00
h2so5 36e0925053 more accurate backtrace lineno 2014-01-30 10:08:04 +09:00
Yukihiro "Matz" Matsumoto c150f115a1 adjust lineno after continuing script files using mrb_partial_hook; close #1652 2014-01-08 13:05:19 +09:00
Yukihiro "Matz" Matsumoto 9c6398a444 rename mrb_intern2() to mrb_intern(); huge API incompatibility; close #1513 2013-11-29 08:47:28 +09:00
Yukihiro "Matz" Matsumoto edd6c17c1e load_exec() no longer return fixnum value for no_exec; should close #1569 2013-11-13 15:48:13 +09:00
Yukihiro "Matz" Matsumoto 3bbf66f9f3 cancel #1565 since it breaks mirb; instead add special treatment to heredocs 2013-11-10 04:32:57 +09:00
Yukihiro "Matz" Matsumoto 29792d1725 Merge branch 'master' of github.com:mruby/mruby 2013-11-09 23:29:50 +09:00
Yukihiro "Matz" Matsumoto ec0a94dae6 Merge pull request #1565 from Fleurer/fix1564
nextc(): always return an '\n' at end of input
2013-11-08 17:22:59 -08:00
fleuria fa71403bc5 nextc(): always return an '\n' at end of input
fix #1564
2013-11-08 11:40:26 +08:00
Yukihiro "Matz" Matsumoto e92d4e2680 modified to use irep->reps to reference child ireps. preparation for
removing irep array from mrb_state.  note that instructions OP_LAMBDA,
OP_EXEC and OP_EPUSH are incompatible, and dumped mrb format has changed.
2013-11-07 03:54:22 +09:00
Yukihiro "Matz" Matsumoto f80401de6c resolved conflicts and updated to latest return value change of mrb_generate_code() 2013-11-05 00:13:01 +09:00
fleuria a511957ec8 refactor mrb_context_run() 2013-11-03 12:05:25 +08:00
Yukihiro "Matz" Matsumoto 0be572df62 change return value from mrb_generate_code() 2013-11-02 23:20:04 +09:00
fleuria c64cae4d2d fix 3a4c8e2
unfortunately the previouse commit is incorrect, which still concate the
keywords, but like this:

      method='"end\nb"' (201)
2013-10-30 17:17:13 +08:00
fleuria 3a4c8e2d9f fix #1550
emit a "\n" as the first token for parser instead of taking the
first character from the next file for lexer, to prevent mruby
"concatenate" two keywords between files

it should be regarded as a work around, for it can not resolve
this case:

$ cat a.rb
"
$ cat b.rb
b"

$ bin/mrbc -o- -v a.rb b.rb
mruby - Embeddable Ruby  Copyright (c) 2010-2013 mruby
developers
NODE_SCOPE:
        NODE_BEGIN:
                NODE_STR "

b " len 4
irep 0 nregs=2 nlocals=1 pools=1 syms=0
000 OP_STRING   R1      "\n\nb "
001 OP_STOP

thanks @bovi 's idea
2013-10-30 10:34:28 +08:00
Yukihiro "Matz" Matsumoto 11b0dda641 Merge pull request #1509 from FUKUZAWA-Tadashi/heredoc-bugfix
fix bugs on Heredocument
2013-09-25 18:02:00 -07:00
Yuichi Nishiwaki 0e4a7b2a03 eliminate use of traditional intern API (mrb_intern()) completely 2013-09-23 19:36:50 -07:00
FUKUZAWA-Tadashi 8d34e00102 fix bugs on Heredocument
- heredoc in array literal
- heredoc in args
- heredoc in expression expand
2013-09-22 18:14:40 +09:00
Yukihiro "Matz" Matsumoto d74887f582 incomplete renaming node->filename -> node->filename_index 2013-09-20 15:41:59 +09:00
Cremno 501df71833 MSVC: compilation works again (+minor style fixes) 2013-09-03 21:15:14 +02:00
take_cheeze d606f9d33f fix line number after first file 2013-09-03 00:29:49 +09:00
take_cheeze 8588c54452 declare variable outside for 2013-09-02 22:12:55 +09:00
take_cheeze 0b806ca17b reduce node size 2013-09-02 00:48:07 +09:00
take_cheeze 3d1fffbd6b support multiple filename in irep 2013-09-02 00:48:06 +09:00
Carson McDonald 7d41835ded Fix return block argument error 2013-08-14 16:56:42 -04:00
Jack Danger Canty 2bf4952284 Adding line numbers to the output of mirb.
Before:

    > "hi"
    hi
    > d
    (mirb):1: undefined method 'd' for main (NoMethodError)
    > d
    (mirb):1: undefined method 'd' for main (NoMethodError)
    > "hi"
    hi
    > "#{'}"
    line 1: unterminated string meets end of file

After

    > "hi"
    hi
    > d
    (mirb):2: undefined method 'd' for main (NoMethodError)
    > d
    (mirb):3: undefined method 'd' for main (NoMethodError)
    > "hi"
    hi
    > "#{'}"
    line 5: unterminated string meets end of file
2013-08-13 09:53:52 -07:00
Cremno 08911d1c82 parse.y: fixed bison 3.0 warning
YACC  src/parse.y -> build/host/src/y.tab.c
src/parse.y:936.1-12: warning: deprecated directive, use ‘%pure-parser’
[-Wdeprecated]
%pure_parser
2013-08-09 03:30:08 +02:00
Cremno 29381bc819 parse.y: don't use strcat 2013-08-07 20:35:38 +02:00
Carson McDonald 5bd60f4662 End loop if nextc is -1 2013-08-02 17:08:55 -04:00
Yukihiro "Matz" Matsumoto 7f282429b0 ci->target_class should be updated as well; #1418 2013-08-01 11:56:20 +09:00
Yukihiro "Matz" Matsumoto 326396a6e3 remove unused mrb_proc_new_with_target() 2013-07-31 00:16:55 +09:00
Yukihiro "Matz" Matsumoto dbd36128ad forget to re-initialize target_class for top-level eval; close #1418 2013-07-30 01:33:02 +09:00
fleuria 620e323d15 replace assert with mrb_assert 2013-07-25 03:00:03 +08:00
Takashi Sogabe dfb4d555c4 Avoid read_escape() in case of regexp 2013-06-27 17:15:18 +09:00
Yukihiro "Matz" Matsumoto b01670a3d3 fixed a bug in push back list; close #1298 2013-06-24 00:41:34 +09:00
h2so5 b543046070 Use casting instead of a macro 2013-06-10 07:17:46 +09:00
h2so5 f8df722e92 Replace isupper with a macro in msvc 2013-06-09 23:05:35 +09:00
Yukihiro "Matz" Matsumoto 95fb1fd809 mrbc to take multiple files, preserving debug information if -g given; close #1243 2013-05-14 23:39:56 +09:00
Yukihiro "Matz" Matsumoto b7a24de377 change mrb_bug to get mrb_state and %S formatter 2013-05-10 22:11:28 +09:00
Masaki Muranaka f139320635 Revert file access mode to 0644. 2013-04-29 09:25:54 +09:00