summaryrefslogtreecommitdiff
path: root/prism/templates
AgeCommit message (Collapse)Author
2024-04-05[ruby/prism] Bump to v0.25.0Kevin Newton
https://github.com/ruby/prism/commit/4da514456f
2024-04-05[ruby/prism] Warn on unused local variablesKevin Newton
https://github.com/ruby/prism/commit/de111935fb
2024-04-04[ruby/prism] Change forwarding error messages to match CRubyKevin Newton
https://github.com/ruby/prism/commit/6a15e475c9
2024-04-03[ruby/prism] Fix up pm_node_list_growKevin Newton
https://github.com/ruby/prism/commit/7784365d3f
2024-04-03[ruby/prism] Pass block exits up the treeKevin Newton
https://github.com/ruby/prism/commit/168f72b9fe
2024-04-03[ruby/prism] Introduce PM_NODE_LIST_FOREACH to make it easier to iterate ↵Kevin Newton
over node lists https://github.com/ruby/prism/commit/5d4da7c69c
2024-04-03[ruby/prism] Allow block exits in defined? and fix modifier while/untilKevin Newton
https://github.com/ruby/prism/commit/2752f0b8df
2024-04-03[ruby/prism] Update fixtures to be all valid RubyKevin Newton
https://github.com/ruby/prism/commit/a0b978d25b
2024-04-03[ruby/prism] Correct errors for invalid retryKevin Newton
https://github.com/ruby/prism/commit/96ca6e51fc
2024-04-03[ruby/prism] Log errors for invalid jumpsKevin Newton
https://github.com/ruby/prism/commit/892d0f9310
2024-04-03[ruby/prism] Match circular parameter error messageKevin Newton
https://github.com/ruby/prism/commit/c0381b10e4
2024-04-01[ruby/prism] Fix up error messages for empty global variableKevin Newton
https://github.com/ruby/prism/commit/fa7559d40b
2024-04-01[ruby/prism] Match error messages for invalid instance/class variablesKevin Newton
https://github.com/ruby/prism/commit/82fd0599ed
2024-04-01[ruby/prism] Match error message for invalid class/module nameKevin Newton
https://github.com/ruby/prism/commit/f00ae59070
2024-04-01[ruby/prism] Match error message for invalid class/module definitionKevin Newton
https://github.com/ruby/prism/commit/1879a9d22e
2024-04-01[ruby/prism] Match error message for multiple blocks givenKevin Newton
https://github.com/ruby/prism/commit/6b594d9d42
2024-04-01[ruby/prism] Fix up error message for invalid numbered reference aliasKevin Newton
https://github.com/ruby/prism/commit/74bff9e834
2024-04-01[ruby/prism] Track duplicate hash keys for pattern matchingKevin Newton
https://github.com/ruby/prism/commit/71ea82f299
2024-04-01[ruby/prism] Track captures in pattern matching for duplicatesKevin Newton
https://github.com/ruby/prism/commit/aa2182f064
2024-03-29[PRISM] Fix error message for duplicate parameter nameKevin Newton
2024-03-29[ruby/prism] Fix calloc argument orderKevin Newton
https://github.com/ruby/prism/commit/9947ab13c0
2024-03-28[ruby/prism] Ensure deserialization works with errors+warnings>256Kevin Newton
https://github.com/ruby/prism/commit/f540e830b5
2024-03-28[ruby/prism] CLI -x flagKevin Newton
https://github.com/ruby/prism/commit/2068e3c30a
2024-03-25[ruby/prism] Fix incorrect paring when using invalid regexp optionsKoichi ITO
Fixes https://github.com/ruby/prism/pull/2617. There was an issue with the lexer as follows. The following are valid regexp options: ```console $ bundle exec ruby -Ilib -rprism -ve 'p Prism.lex("/x/io").value.map {|token| token[0].type }' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [:REGEXP_BEGIN, :STRING_CONTENT, :REGEXP_END, :EOF] ``` The following are invalid regexp options. Unnecessary the `IDENTIFIER` token is appearing: ```console $ bundle exec ruby -Ilib -rprism -ve 'p Prism.lex("/x/az").value.map {|token| token[0].type }' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [:REGEXP_BEGIN, :STRING_CONTENT, :REGEXP_END, :IDENTIFIER, :EOF] ``` As a behavior of Ruby, when given `A` to `Z` and `a` to `z`, they act as invalid regexp options. e.g., ```console $ ruby -e '/regexp/az' -e:1: unknown regexp options - az /regexp/az -e: compile error (SyntaxError) ``` Thus, it should probably not be construed as `IDENTIFIER` token. Therefore, `pm_byte_table` has been adapted to accept those invalid regexp option values. Whether it is a valid regexp option or not is checked by `pm_regular_expression_flags_create`. For invalid regexp options, `PM_ERR_REGEXP_UNKNOWN_OPTIONS` is added to diagnostics. https://github.com/ruby/prism/commit/d2a6096fcf
2024-03-20[ruby/prism] Provide options for reducing sizeKevin Newton
https://github.com/ruby/prism/commit/592128de4d
2024-03-19[ruby/prism] Fix a diagnostic incompatibilityKoichi ITO
This PR fixes a diagnostic incompatibility when using no anonymous keyword rest parameter: ```ruby foo(**) ``` Note, although the actual update applies only to the `foo(**)` case, for reference, `foo(*)` and `foo(&) are also mentioned below. ## Ruby (Expected) ```console $ ruby -cve 'foo(*)' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] -e:1: no anonymous rest parameter -e: compile error (SyntaxError) $ ruby -cve 'foo(**)' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] -e:1: no anonymous keyword rest parameter -e: compile error (SyntaxError) $ ruby -cve 'foo(&)' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] -e:1: no anonymous block parameter -e: compile error (SyntaxError) ``` ## Prism (Actual) Before: ```console $ bundle exec ruby -Ilib -rprism -wve 'p Prism.parse("foo(*)").errors' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:argument_no_forwarding_star @message="unexpected `*` when the parent method is not forwarding" @location=#<Prism::Location @start_offset=4 @length=1 start_line=1> @level=:fatal>] $ bundle exec ruby -Ilib -rprism -wve 'p Prism.parse("foo(**)").errors' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:expect_expression_after_splat_hash @message="expected an expression after `**` in a hash" @location=#<Prism::Location @start_offset=4 @length=2 start_line=1> @level=:fatal>] $ bundle exec ruby -Ilib -rprism -wve 'p Prism.parse("foo(&)").errors' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:argument_no_forwarding_amp @message="unexpected `&` when the parent method is not forwarding" @location=#<Prism::Location @start_offset=4 @length=1 start_line=1> @level=:fatal>] ``` After: ```console $ bundle exec ruby -Ilib -rprism -wve 'p Prism.parse("foo(*)").errors' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:argument_no_forwarding_star @message="unexpected `*` when the parent method is not forwarding" @location=#<Prism::Location @start_offset=4 @length=1 start_line=1> @level=:fatal>] $ bundle exec ruby -Ilib -rprism -wve 'p Prism.parse("foo(**)").errors' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:argument_no_forwarding_star_star @message="unexpected `**` when the parent method is not forwarding" @location=#<Prism::Location @start_offset=4 @length=2 start_line=1> @level=:fatal>] $ bundle exec ruby -Ilib -rprism -wve 'p Prism.parse("foo(&)").errors' ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:argument_no_forwarding_amp @message="unexpected `&` when the parent method is not forwarding" @location=#<Prism::Location @start_offset=4 @length=1 start_line=1> @level=:fatal>] ``` https://github.com/ruby/prism/commit/633c9d9fd4
2024-03-18[ruby/prism] Warn on frozen_string_literal after tokensKevin Newton
https://github.com/ruby/prism/commit/edece87801
2024-03-18[ruby/prism] CRuby error message for lonely elseKevin Newton
https://github.com/ruby/prism/commit/1219a709e4
2024-03-18[ruby/prism] Use `require_relative` in the Prism codebaseKoichi ITO
If there are many searches in the `$LOAD_PATH` in the user environment, require will perform unnecessary searches that are not needed. In contrast, `require_relative` is efficient because it uses a relative path. https://github.com/ruby/prism/commit/438ccc67bd
2024-03-15[ruby/prism] Shareable constant nodesKevin Newton
https://github.com/ruby/prism/commit/473cfed6d0
2024-03-13[ruby/prism] Warn for maximum number variablesKevin Newton
https://github.com/ruby/prism/commit/2cdbf81c95
2024-03-13[ruby/prism] Warn `&` interpreted as argument prefixKoichi ITO
This PR makes `Prism` warn `&` interpreted as argument prefix. This carries a similar meaning to the following Ruby warning: ```console $ ruby -cwe "foo &bar" -e:1: warning: `&' interpreted as argument prefix Syntax OK ``` Previously, it did not issue a warning: ```console $ bundle exec ruby -rprism -ve "p Prism.parse('foo &bar').warnings" ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [] ``` From now on, it will issue a warning similar to Ruby's: ```console $ bundle exec ruby -rprism -ve "p Prism.parse('foo &bar').warnings" ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseWarning @type=:ambiguous_prefix_amp @message="ambiguous `&` has been interpreted as an argument prefix" @location=#<Prism::Location @start_offset=4 @length=1 start_line=1> @level=:verbose>] ``` https://github.com/ruby/prism/commit/312f99cd1e
2024-03-13[ruby/prism] Warn `**` interpreted as argument prefixKoichi ITO
This PR makes Prism warn `**` interpreted as argument prefix. This carries a similar meaning to the following Ruby warning: ```console $ ruby -cwe "foo **bar" -e:1: warning: `**' interpreted as argument prefix Syntax OK ``` Previously, it did not issue a warning: ```console $ bundle exec ruby -rprism -ve "p Prism.parse('foo **bar').warnings" ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [] ``` From now on, it will issue a warning similar to Ruby's: ```console $ bundle exec ruby -rprism -ve "p Prism.parse('foo **bar').warnings" ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22] [#<Prism::ParseWarning @type=:ambiguous_prefix_star_star @message="ambiguous `**` has been interpreted as an argument prefix" @location=#<Prism::Location @start_offset=4 @length=2 start_line=1> @level=:verbose>] ``` https://github.com/ruby/prism/commit/f6cb5c314c
2024-03-12[ruby/prism] Add warning for chained comparisonsKevin Newton
https://github.com/ruby/prism/commit/f9f3620d44
2024-03-12[ruby/prism] Add whitespace warningsKevin Newton
https://github.com/ruby/prism/commit/01d137a0cb
2024-03-12[ruby/prism] Warnings for incorrect character literal syntaxKevin Newton
https://github.com/ruby/prism/commit/909508296e
2024-03-12[ruby/prism] Consolidate warnings for conditional predicatesKevin Newton
* Also add warnings for literals in predicates * Also create flip-flops in while/until https://github.com/ruby/prism/commit/a6b5c523c2
2024-03-08[ruby/prism] Fix up regexp memory leaksKevin Newton
https://github.com/ruby/prism/commit/4dc58a533a
2024-03-08[ruby/prism] Add initial implementation of `Regexp` validation.Kevin Menard
https://github.com/ruby/prism/commit/6bf1b8edf0
2024-03-07[ruby/prism] Shared integer parsing logicKevin Newton
https://github.com/ruby/prism/commit/a2594a23c1
2024-03-07[ruby/prism] Change pm_integer_t structuretompng
https://github.com/ruby/prism/commit/588acf823f
2024-03-07[ruby/prism] Make pm_integer -> Integer fastertompng
https://github.com/ruby/prism/commit/47601e7928
2024-03-06[ruby/prism] Fix rebase templatesKevin Newton
https://github.com/ruby/prism/commit/31b8c6142f
2024-03-06[ruby/prism] Use the diagnostic types in the parser translation layerKevin Newton
https://github.com/ruby/prism/commit/1a8a0063dc
2024-03-06[ruby/prism] Expose types on diagnosticsKevin Newton
https://github.com/ruby/prism/commit/a735c2262f
2024-03-06[ruby/prism] Move polyfill to separate file to type-check it independently.Ufuk Kayserilioglu
https://github.com/ruby/prism/commit/2a583b041b
2024-03-06[ruby/prism] `Prism::Compiler` should be a subclass of `Prism::Visitor`Ufuk Kayserilioglu
https://github.com/ruby/prism/commit/a01d6a4e32
2024-03-06[ruby/prism] Fix some missing methods/signatures in RBIsUfuk Kayserilioglu
https://github.com/ruby/prism/commit/1d87b8c46c
2024-03-06[ruby/prism] Move template related methods/classes under `Prism::Template` ↵Ufuk Kayserilioglu
namespace https://github.com/ruby/prism/commit/0e4dbcd3e4
2024-03-04[ruby/prism] Provide API for visiting in CKevin Newton
https://github.com/ruby/prism/commit/537947aa5c