Replies: 3 comments 3 replies
-
A few questions:
Are you going to emulate those states in YARP? I'd really like to turn lexer into (almost) stateless module if possible.
WDYT about emitting tokens separately? They do not participate in AST construction at all. In
What is this token responsible for?
Please correct if I'm wrong but arguments is a part of the block/method declaration and parameters is what is passed to a method call, that's what I think I've in all parsers, but of course I can't find it explicitly stated anywhere. Is this node about method/block definition?
I'd recommend to merge it with Def/Defs
What is this node?
Can it be a single
I understand the difference between
What is this node? Is for a setter call?
What are these nodes?
Can we merge these nodes into a single MLHS with optional begin/end locations?
Is it a node type? Is it for empty parentheses? Can it be a Statements node?
Is it for gvar/nthref alias? If so, can be it merged with Alias node?
Or is this node for empty parentheses? If so same question as above: Can it be a Statements node?
parser gem emits is as Begin (Statements in our case), can we do the same thing? Or is it a token type?
What is this node? Or is a token too?
Are we going to introduce these nodes at all? Sorry if the list wasn't ready. Feel free to ignore this comment if so, I'll update it later. |
Beta Was this translation helpful? Give feedback.
-
@eregon, @iliabylich, @enebo, @chrisseaton I've tagged v0.1.0 with a status report of everything I could think of. I've also updated this document with the current state of the project. Obviously tons of stuff still to do, but I'm happy with the progress so far. If you have any glaring issues with the direction we're going in, let me know. Otherwise we'll keep trucking next week. |
Beta Was this translation helpful? Give feedback.
-
@eregon, @iliabylich, @enebo, @chrisseaton I've tagged v0.2.0 with a status report if you're interested. |
Beta Was this translation helpful? Give feedback.
-
This is a very general roadmap/status update that contains the latest information of the development of the new parser. The bullets are the nodes in syntax tree that loosely correspond to the nodes we're adding to this tree.
Tokens
EXPR_FNAME
.XStringBeg
node.YP_TOKEN_CHARACTER_LITERAL
/StringNode
YP_TOKEN_CLASS_VARIABLE
/ClassVariableRead
/ClassVariableWrite
YP_TOKEN_COMMA
yp_comment_t
YP_TOKEN_CONSTANT
yp_comment_t
YP_TOKEN_EMBVAR
yp_comment_t
YP_TOKEN_FLOAT
/FloatLiteral
YP_TOKEN_GLOBAL_VARIABLE
/GlobalVariableRead
/GlobalVariableWrite
YP_TOKEN_INSTANCE_VARIABLE
/InstanceVariableRead
/InstanceVariableWrite
YP_TOKEN_IMAGINARY_NUMBER
/ImaginaryLiteral
YP_TOKEN_INTEGER
/IntegerLiteral
YP_TOKEN_IDENTIFIER
YP_TOKEN_KEYWORD___ENCODING__
,YP_TOKEN_KEYWORD___LINE__
,YP_TOKEN_KEYWORD___FILE__
,YP_TOKEN_KEYWORD_ALIAS
,YP_TOKEN_KEYWORD_AND
,YP_TOKEN_KEYWORD_BEGIN
,YP_TOKEN_KEYWORD_BEGIN_UPCASE
,YP_TOKEN_KEYWORD_BREAK
,YP_TOKEN_KEYWORD_CASE
,YP_TOKEN_KEYWORD_CLASS
,YP_TOKEN_KEYWORD_DEF
,YP_TOKEN_KEYWORD_DEFINED
,YP_TOKEN_KEYWORD_DO
,YP_TOKEN_KEYWORD_ELSE
,YP_TOKEN_KEYWORD_ELSIF
,YP_TOKEN_KEYWORD_END
,YP_TOKEN_KEYWORD_END_UPCASE
,YP_TOKEN_KEYWORD_ENSURE
,YP_TOKEN_KEYWORD_FALSE
,YP_TOKEN_KEYWORD_FOR
,YP_TOKEN_KEYWORD_IF
,YP_TOKEN_KEYWORD_IN
,YP_TOKEN_KEYWORD_MODULE
,YP_TOKEN_KEYWORD_NEXT
,YP_TOKEN_KEYWORD_NIL
,YP_TOKEN_KEYWORD_NOT
,YP_TOKEN_KEYWORD_OR
,YP_TOKEN_KEYWORD_REDO
,YP_TOKEN_KEYWORD_RESCUE
,YP_TOKEN_KEYWORD_RETRY
,YP_TOKEN_KEYWORD_RETURN
,YP_TOKEN_KEYWORD_SELF
,YP_TOKEN_KEYWORD_SUPER
,YP_TOKEN_KEYWORD_THEN
,YP_TOKEN_KEYWORD_TRUE
,YP_TOKEN_KEYWORD_UNDEF
,YP_TOKEN_KEYWORD_UNLESS
,YP_TOKEN_KEYWORD_UNTIL
,YP_TOKEN_KEYWORD_WHEN
,YP_TOKEN_KEYWORD_WHILE
,YP_TOKEN_KEYWORD_YIELD
YP_TOKEN_BRACE_LEFT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
,YP_TOKEN_SLASH_EQUAL
,YP_TOKEN_STAR
,YP_TOKEN_STAR_EQUAL
,YP_TOKEN_STAR_STAR
,YP_TOKEN_STAR_STAR_EQUAL
,YP_TOKEN_TILDE
,YP_TOKEN_TILDE_AT
YP_TOKEN_DOT
YP_TOKEN_PERCENT_LOWER_I
YP_TOKEN_PERCENT_LOWER_W
YP_TOKEN_BRACE_RIGHT
YP_TOKEN_BRACKET_RIGHT
YP_TOKEN_PARENTHESIS_RIGHT
YP_TOKEN_RATIONAL_NUMBER
/RationalLiteral
YP_TOKEN_REGEXP_BEGIN
YP_TOKEN_REGEXP_END
YP_TOKEN_SYMBOL_BEGIN
- This is definitely not being handled correctly as it needs to differentiate itself from a ternary operator through a bunch of state that we don't currently track.YP_TOKEN_PERCENT_UPPER_I
YP_TOKEN_LAMBDA_BEGIN
- We're not actually handling this correctly yet though, only in the cases where there are no parameters.YP_TOKEN_MINUS_GREATER
YP_TOKEN_STRING_BEGIN
YP_TOKEN_STRING_CONTENT
YP_TOKEN_STRING_END
YP_TOKEN_PERCENT_UPPER_W
Lists
ArrayNode
ArrayNode
ArrayNode
ArrayNode
StringNode
/InterpolatedStringNode
ArrayNode
Blocks
PreExecutionNode
BlockParameterNode
ClassNode
DefNode
PostExecutionNode
KeywordRestParameterNode
ModuleNode
ParametersNode
RestParameterNode
SClassNode
Control flow
BreakNode
ElseNode
IfNode
EnsureNode
ForNode
IfNode
Ternary
NextNode
RedoNode
RescueModifierNode
/RescueNode
RetryNode
ReturnNode
SuperNode
/ForwardingSuperNode
UnlessNode
UntilNode
WhileNode
YieldNode
Expressions
AliasNode
CallNode
,ClassVariableWrite
,ConstantPathWriteNode
,GlobalVariableWrite
,InstanceVariableWrite
,LocalVariableWrite
AssocNode
AssocSplatNode
CallNode
,AndNode
, andOrNode
ConstantPathNode
andConstantPathWriteNode
ConstantRead
DefinedNode
RangeNode
CallNode
HashNode
MultiTargetNode
CallNode
OperatorAssignmentNode
,OperatorAndAssignmentNode
, andOperatorOrAssignmentNode
ParenthesesNode
Program
Statements
AliasNode
LocalVariableWrite
TrueNode
,FalseNode
,NilNode
, andLocalVariableRead
.UnaryNode
UndefNode
Strings
SymbolNode
andInterpolatedSymbolNode
StringInterpolated
nodes now.RegularExpressionNode
/InterpolatedRegularExpressionNode
StringNode
.GlobalVariableRead
/ClassVariableRead
/InstanceVariableRead
StringInterpolatedNode
StringNode
andInterpolatedStringNode
SymbolNode
XStringNode
/InterpolatedXStringNode
Method calls
CallNode
CallNode
CallNode
Pattern matching
Beta Was this translation helpful? Give feedback.
All reactions