on master help sign in
Remove some commented out code

This stuff should no longer be relevant to the code that is being written elsewhere in the file.

commita48188b89123e08b0cc86aca495b357eec48686d authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 8 May 2019, 17:35 (7 years ago) parent46abd86
1 file changed−80
compiler/src/Reporting/Error/Syntax.hs−80
compiler/src/Reporting/Error/Syntax.hs−80
@@ -2291,20 +2291,6 @@ toFuncReport source context func startRow startCol =
22912291 "I need a single digit between 0 and 9 inclusive."
22922292 )
22932293
2294− Operator ->
2295− Report.Report "EXPECTING AN OPERATOR" region [] $
2296− Report.toCodeSnippet source region Nothing
2297− (
2298− D.reflow $
2299− "I was expecting an operator here:"
2300− ,
2301− D.stack
2302− [ D.reflow "Some of the most common operators are:"
2303− , D.indent 4 $ D.vcat ["+","-","*","&&","||"]
2304− , D.reflow "Something like that!"
2305− ]
2306− )
2307−
23082294 Wildcard ->
23092295 Report.Report "EXPECTING A WILDCARD" region [] $
23102296 Report.toCodeSnippet source region Nothing
@@ -2347,19 +2333,6 @@ toFuncReport source context func startRow startCol =
23472333 \ are nearby with some sort of (abs (actual - expected) < 0.001) check."
23482334 )
23492335
2350− FieldNamePattern ->
2351− Report.Report "EXPECTING A FIELD NAME" region [] $
2352− Report.toCodeSnippet source region Nothing
2353− (
2354− D.reflow $
2355− "I was expecting a field name here:"
2356− ,
2357− D.fillSep $
2358− ["A","name","like",D.dullyellow "id" <> ",",D.dullyellow "status" <> ","
2359− ,"or","whatever","field","you","want","to","access."
2360− ]
2361− )
2362−
23632336 -- Parse.Expression
23642337
23652338 MatchingName name ->
@@ -2396,57 +2369,4 @@ toFuncReport source context func startRow startCol =
23962369 ]
23972370 )
23982371
2399−
2400−-- CONTEXT
2401−
2402−
2403−contextToString :: String -> String -> ContextStack -> String
2404−contextToString defaultString prefixString stack =
2405− case stack of
2406− [] ->
2407− defaultString
2408−
2409− (context, _) : rest ->
2410− let anchor = getAnchor rest in
2411− prefixString <>
2412− case context of
2413− ExprIf -> "an `if` expression" <> anchor
2414− ExprLet -> "a `let` expression" <> anchor
2415− ExprFunc -> "an anonymous function" <> anchor
2416− ExprCase -> "a `case` expression" <> anchor
2417− ExprList -> "a list" <> anchor
2418− ExprTuple -> "an expression (in parentheses)" <> anchor
2419− ExprRecord -> "a record" <> anchor
2420− Definition name -> Name.toChars name <> "'s definition"
2421− Annotation name -> Name.toChars name <> "'s type annotation"
2422− TypeTuple -> "a type (in parentheses)" <> anchor
2423− TypeRecord -> "a record type" <> anchor
2424− PatternList -> "a list pattern" <> anchor
2425− PatternTuple -> "a pattern (in parentheses)" <> anchor
2426− PatternRecord -> "a record pattern" <> anchor
2427− Module -> "a module declaration"
2428− Import -> "an import"
2429− TypeUnion -> "a union type"
2430− TypeAlias -> "a type alias"
2431− Infix -> "an infix declaration"
2432− Port -> "a port declaration"
2433−
2434−
2435−getAnchor :: ContextStack -> String
2436−getAnchor stack =
2437− case stack of
2438− [] ->
2439− ""
2440−
2441− (context, _) : rest ->
2442− case context of
2443− Definition name ->
2444− " in " <> Name.toChars name <> "'s definition"
2445−
2446− Annotation name ->
2447− " in " <> Name.toChars name <> "'s type annotation"
2448−
2449− _ ->
2450− getAnchor rest
2451−
24522372-}