summaryrefslogtreecommitdiff
path: root/prism/parser.h
AgeCommit message (Collapse)Author
2024-10-04[ruby/prism] Fix up multi target parsingKevin Newton
https://github.com/ruby/prism/commit/80cd335222
2024-10-03[ruby/prism] Pop lex mode for heredocs in the lexer, not the parserKevin Newton
https://github.com/ruby/prism/commit/5dd36b979e
2024-09-20[ruby/prism] Introduce partial_script optionKevin Newton
https://github.com/ruby/prism/commit/b28877fa4f
2024-07-22[ruby/prism] Implement mismatched indentation warningKevin Newton
https://github.com/ruby/prism/commit/5d5bf92be8
2024-07-11[PRISM] Fix up shareable constant castingKevin Newton
2024-07-11[ruby/prism] Add node ids to nodesKevin Newton
https://github.com/ruby/prism/commit/bf16ade7f9
2024-06-10[ruby/prism] Provide ability to lock encoding while parsingKevin Newton
https://github.com/ruby/prism/commit/f7faedfb3f
2024-06-10[ruby/prism] Allow block exits in loop predicatesKevin Newton
https://github.com/ruby/prism/commit/f09db18e46
2024-05-22[ruby/prism] Fix support for 'it' implicit local variableKevin Newton
https://github.com/ruby/prism/commit/53bbcfe513
2024-05-21[ruby/prism] Add error for numbered parameter used in inner blockKevin Newton
https://github.com/ruby/prism/commit/c386ba6d48
2024-04-24[ruby/prism] Warn for nested hashes as wellKevin Newton
https://github.com/ruby/prism/commit/76e802f59e
2024-04-17[ruby/prism] Inline pm_state_stackKevin Newton
2024-04-05[ruby/prism] Provide documentation for the new local tablesKevin Newton
https://github.com/ruby/prism/commit/7a47a1351f
2024-04-05[ruby/prism] Replace old circular parameter definition detectionKevin Newton
https://github.com/ruby/prism/commit/c739f8e194
2024-04-05[ruby/prism] Warn on unused local variablesKevin Newton
https://github.com/ruby/prism/commit/de111935fb
2024-04-05[ruby/prism] Switch locals to use a hashKevin Newton
https://github.com/ruby/prism/commit/f38946021e
2024-04-03[ruby/prism] Allow retry in rescue modifierKevin Newton
https://github.com/ruby/prism/commit/debe19459a
2024-04-03[ruby/prism] No invalid block exits in evalKevin Newton
https://github.com/ruby/prism/commit/85e045ce40
2024-04-03[ruby/prism] Further delineate block typesKevin Newton
https://github.com/ruby/prism/commit/750116e5dc
2024-04-03[ruby/prism] Delineate rescue/else/ensure for more accurate exitsKevin Newton
https://github.com/ruby/prism/commit/92868fad78
2024-04-03[ruby/prism] Pass block exits up the treeKevin Newton
https://github.com/ruby/prism/commit/168f72b9fe
2024-04-03[ruby/prism] Allow block exits in defined? and fix modifier while/untilKevin Newton
https://github.com/ruby/prism/commit/2752f0b8df
2024-03-25[ruby/prism] Fix up minimal build settingKevin Newton
https://github.com/ruby/prism/commit/98c85c4acb
2024-03-25[ruby/prism] Handle CLRF in regexpKevin Newton
https://github.com/ruby/prism/commit/b96bada9ae
2024-03-15[ruby/prism] Shareable constant nodesKevin Newton
https://github.com/ruby/prism/commit/473cfed6d0
2024-03-13[ruby/prism] Change `frozen_string_literal` to be a tri-stateJean Boussier
An explicit `false` is not equivalent to the comment being missing, because the default can be switched with a runtime flag: ```bash $ ruby --enable-frozen-string-literal -e 'p "foo".frozen?' true ``` https://github.com/ruby/prism/commit/4660f58775
2024-03-08[ruby/prism] Simplify the regular expression ASCII-only checkKevin Newton
https://github.com/ruby/prism/commit/b7851f4c2d
2024-03-08[ruby/prism] Track both the unescaped bytes and source string for a regular ↵Kevin Menard
expression so we can accurately set its encoding flags. https://github.com/ruby/prism/commit/dc6dd3a926
2024-03-07[ruby/prism] Fix up tilde heredoc line continuationsKevin Newton
https://github.com/ruby/prism/commit/15e74b2f65
2024-02-29[ruby/prism] Command line options as a bitsetKevin Newton
https://github.com/ruby/prism/commit/369ffbd57e
2024-02-27[ruby/prism] Support -p, -n, -a, and -l command line optionsKevin Newton
https://github.com/ruby/prism/commit/959eb506ca
2024-02-21[ruby/prism] Support ItParametersNodeKevin Newton
So that compilers know they need to add to add an anonymous variable to the local table. https://github.com/ruby/prism/commit/7f1aadd057
2024-02-16[ruby/prism] Disallow numbered parameters within given scopesKevin Newton
https://github.com/ruby/prism/commit/a218a0f265
2024-02-01[PRISM] Emit parse warningsKevin Newton
2024-02-01Sync to latest prismKevin Newton
2024-01-30Update forwarding locals for prismAaron Patterson
2024-01-30[ruby/prism] Better error messages for unexpected tokens in prefixKevin Newton
https://github.com/ruby/prism/commit/a35b8e45ee
2024-01-09[ruby/prism] Clarify __END__ commentKevin Newton
https://github.com/ruby/prism/commit/3e36d5eabc
2024-01-02[ruby/prism] IndexTargetNode should always have ATTRIBUTE_WRITEKevin Newton
Because this is a user-facing change, we also need to deal with the fact that CRuby 3.3.0 was just released. In order to support workflows that want to parse exactly as CRuby parses in a specific version, this PR introduces a new option to the options struct that is "version". This allows you to specify that you want "3.3.0" parsing. I'm not sure if this is the correct solution. Another solution is to just fork and keep around the old branch for security patches. Or we could keep around a copy of the source files within this repository as another directory and only update when necessary. There are a lot of potential solutions here. Because this change is so small and the check for it is so minimal, I've decided to go with this enum. If this ends up entirely cluttering the codebase with version checks, we'll come up with another solution. But for now this works, so we're going to go in this direction for a bit until we determine it's no longer working. https://github.com/ruby/prism/commit/d8c7e6bd10
2023-12-25Revert "Revert all of commits after Prism 0.19.0 release"Hiroshi SHIBATA
This reverts commit d242e8416e99eaee4465e2681210ae8b7ecd6d34.
2023-12-16Revert all of commits after Prism 0.19.0 releaseHiroshi SHIBATA
We should bundle released version of Prism for Ruby 3.3.0
2023-12-15[ruby/prism] Finish keyword hash node flag refactor by renaming flagUfuk Kayserilioglu
https://github.com/ruby/prism/commit/7f812389f8
2023-12-14[ruby/prism] Fix the implementation of the flag on keyword hash nodesUfuk Kayserilioglu
The previous implementation was incorrect since it was just checking for all keys in assoc nodes to be static literals but the actual check is that all keys in assoc nodes must be symbol nodes. This commit fixes that implementation, and, also, aliases the flag to `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` so that ruby/ruby can start using the new flag name. I intend to later change the real flag name to `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` and remove the alias. https://github.com/ruby/prism/commit/f5099c79ce
2023-12-06[ruby/prism] Provide flags for changing encodingsKevin Newton
https://github.com/ruby/prism/commit/e838eaff6f
2023-12-04[ruby/prism] Refactor pm_diagnostic_t and pm_comment_t to use pm_location_tLily Lyons
https://github.com/ruby/prism/commit/115b6a2fc6
2023-12-01[ruby/prism] Change numbered parametersKevin Newton
Previously numbered parameters were a field on blocks and lambdas that indicated the maximum number of numbered parameters in either the block or lambda, respectively. However they also had a parameters field that would always be nil in these cases. This changes it so that we introduce a NumberedParametersNode that goes in place of parameters, which has a single uint8_t maximum field on it. That field contains the maximum numbered parameter in either the block or lambda. As a part of the PR, I'm introducing a new UInt8Field type that can be used on nodes, which is just to make it a little more explicit what the maximum values can be (the maximum is actually 9, since it only goes up to _9). Plus we can do a couple of nice things in serialization like just read a single byte. https://github.com/ruby/prism/commit/2d87303903
2023-12-01[PRISM] Remove transparent scope nodesMatt Valentine-House
2023-11-30[ruby/prism] Remove ability to decode other encodingsKevin Newton
https://github.com/ruby/prism/commit/98e218d989
2023-11-30[PRISM] Consolidate prism encoding filesKevin Newton
2023-11-29[ruby/prism] Convert start line to signed integersJean Boussier
Ruby allows for 0 or negative line start, this is often used with `eval` calls to get a correct offset when prefixing a snippet. e.g. ```ruby caller = caller_locations(1, 1).first class_eval <<~RUBY, caller.path, caller.line - 2 # frozen_string_literal: true def some_method #{caller_provided_code_snippet} end RUBY ``` https://github.com/ruby/prism/commit/0d14ed1452