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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.XStringBegnode.YP_TOKEN_CHARACTER_LITERAL/StringNodeYP_TOKEN_CLASS_VARIABLE/ClassVariableRead/ClassVariableWriteYP_TOKEN_COMMAyp_comment_tYP_TOKEN_CONSTANTyp_comment_tYP_TOKEN_EMBVARyp_comment_tYP_TOKEN_FLOAT/FloatLiteralYP_TOKEN_GLOBAL_VARIABLE/GlobalVariableRead/GlobalVariableWriteYP_TOKEN_INSTANCE_VARIABLE/InstanceVariableRead/InstanceVariableWriteYP_TOKEN_IMAGINARY_NUMBER/ImaginaryLiteralYP_TOKEN_INTEGER/IntegerLiteralYP_TOKEN_IDENTIFIERYP_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_YIELDYP_TOKEN_BRACE_LEFTYP_TOKEN_BRACKET_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STAR,YP_TOKEN_STAR_STAR_EQUAL,YP_TOKEN_TILDE,YP_TOKEN_TILDE_ATYP_TOKEN_DOTYP_TOKEN_PERCENT_LOWER_IYP_TOKEN_PERCENT_LOWER_WYP_TOKEN_BRACE_RIGHTYP_TOKEN_BRACKET_RIGHTYP_TOKEN_PARENTHESIS_RIGHTYP_TOKEN_RATIONAL_NUMBER/RationalLiteralYP_TOKEN_REGEXP_BEGINYP_TOKEN_REGEXP_ENDYP_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_IYP_TOKEN_LAMBDA_BEGIN- We're not actually handling this correctly yet though, only in the cases where there are no parameters.YP_TOKEN_MINUS_GREATERYP_TOKEN_STRING_BEGINYP_TOKEN_STRING_CONTENTYP_TOKEN_STRING_ENDYP_TOKEN_PERCENT_UPPER_WLists
ArrayNodeArrayNodeArrayNodeArrayNodeStringNode/InterpolatedStringNodeArrayNodeBlocks
PreExecutionNodeBlockParameterNodeClassNodeDefNodePostExecutionNodeKeywordRestParameterNodeModuleNodeParametersNodeRestParameterNodeSClassNodeControl flow
BreakNodeElseNodeIfNodeEnsureNodeForNodeIfNodeTernaryNextNodeRedoNodeRescueModifierNode/RescueNodeRetryNodeReturnNodeSuperNode/ForwardingSuperNodeUnlessNodeUntilNodeWhileNodeYieldNodeExpressions
AliasNodeCallNode,ClassVariableWrite,ConstantPathWriteNode,GlobalVariableWrite,InstanceVariableWrite,LocalVariableWriteAssocNodeAssocSplatNodeCallNode,AndNode, andOrNodeConstantPathNodeandConstantPathWriteNodeConstantReadDefinedNodeRangeNodeCallNodeHashNodeMultiTargetNodeCallNodeOperatorAssignmentNode,OperatorAndAssignmentNode, andOperatorOrAssignmentNodeParenthesesNodeProgramStatementsAliasNodeLocalVariableWriteTrueNode,FalseNode,NilNode, andLocalVariableRead.UnaryNodeUndefNodeStrings
SymbolNodeandInterpolatedSymbolNodeStringInterpolatednodes now.RegularExpressionNode/InterpolatedRegularExpressionNodeStringNode.GlobalVariableRead/ClassVariableRead/InstanceVariableReadStringInterpolatedNodeStringNodeandInterpolatedStringNodeSymbolNodeXStringNode/InterpolatedXStringNodeMethod calls
CallNodeCallNodeCallNodePattern matching
Beta Was this translation helpful? Give feedback.
All reactions