negating bool crashes parser
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia da Ink.Parsed.UnaryExpression.WithInner e segui il percorso Ink.InkParser.ExpressionUnary per l’input { -true }. Confronta la sua gestione con il caso supportato {-(2 == 2)}; done dovrebbe produrre un normale errore di runtime invece di un’eccezione del parser non gestita e di uno stack trace.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I was writing some test cases for my Go Ink runtime engine, and testing some scenarios with numeric type coercions.
I noticed most unsupported operations produce an error like:
RUNTIME ERROR: (0.183): Cannot perform operation '-' on String
However, trying to negate a boolean literal results in a stack trace in the parser itself:
{-true}
Unhandled exception. System.Exception: Unexpected operation or number type
at Ink.Parsed.UnaryExpression.WithInner(Expression inner, String op)
at Ink.InkParser.ExpressionUnary()
at Ink.InkParser.Expression(Int32 minimumPrecedence)
at Ink.InkParser.Expression()
at Ink.StringParser.Parse[T](SpecificParseRule`1 rule)
at Ink.InkParser.ConditionExpression()
at Ink.InkParser.InnerLogic()
at Ink.StringParser.ParseObject(ParseRule rule)
at Ink.StringParser.Expect(ParseRule rule, String message, ParseRule recoveryRule)
at Ink.InkParser.InlineLogic()
at Ink.StringParser.ParseObject(ParseRule rule)
at Ink.StringParser.OneOf(ParseRule[] array)
at Ink.InkParser.InlineLogicOrGlueOrStartTag()
at Ink.StringParser.ParseObject(ParseRule rule)
at Ink.StringParser.<>c__DisplayClass58_0.<Optional>b__0()
at Ink.StringParser.ParseObject(ParseRule rule)
at Ink.StringParser.Interleave[T](ParseRule ruleA, ParseRule ruleB, ParseRule untilTerminator, Boolean flatten)
at Ink.InkParser.MixedTextAndLogic()
at Ink.StringParser.Parse[T](SpecificParseRule`1 rule)
at Ink.InkParser.LineOfMixedTextAndLogic()
at Ink.StringParser.ParseObject(ParseRule rule)
at Ink.StringParser.OneOf(ParseRule[] array)
at Ink.InkParser.StatementAtLevel(StatementLevel level)
at Ink.InkParser.<>c__DisplayClass145_0.<StatementsAtLevel>b__0()
at Ink.StringParser.ParseObject(ParseRule rule)
at Ink.StringParser.Interleave[T](ParseRule ruleA, ParseRule ruleB, ParseRule untilTerminator, Boolean flatten)
at Ink.InkParser.StatementsAtLevel(StatementLevel level)
at Ink.InkParser.Parse()
at Ink.Compiler.Parse()
at Ink.Compiler.Compile()
at Ink.CommandLineTool..ctor(String[] args)
at Ink.CommandLineTool.Main(String[] args)
Abort trap: 6
This seems unlikely to serve a practical purpose in a real story, but wanted to document it since this results in a big stack trace in the Inky UI if you write it there, and negating boolean values at runtime seems to be supported, e.g.:
{-(2 == 2)}
- Lingua principale
- C#
- Stelle
- 5k
- Fork
- 550
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di inkle/ink
-
inklecate stack overflow - Knot and variable with same nameForse già presa @voidsipp l’ha presa 19 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
TunnelsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Issue simili
-
hand-to-AI
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
DXF with empty names failsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
bug python
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
I maintainer di solito rispondono entro 13 giorni