{"action":"closed","issue":{"url":"https://api.github.com/repos/mathnet/mathnet-symbolics/issues/6","labels_url":"https://api.github.com/repos/mathnet/mathnet-symbolics/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mathnet/mathnet-symbolics/issues/6/comments","events_url":"https://api.github.com/repos/mathnet/mathnet-symbolics/issues/6/events","html_url":"https://github.com/mathnet/mathnet-symbolics/issues/6","id":110855100,"number":6,"title":"Parsing constants as identifiers","user":{"login":"Zaid-Ajaj","id":13316248,"avatar_url":"https://avatars.githubusercontent.com/u/13316248?v=3","gravatar_id":"","url":"https://api.github.com/users/Zaid-Ajaj","html_url":"https://github.com/Zaid-Ajaj","followers_url":"https://api.github.com/users/Zaid-Ajaj/followers","following_url":"https://api.github.com/users/Zaid-Ajaj/following{/other_user}","gists_url":"https://api.github.com/users/Zaid-Ajaj/gists{/gist_id}","starred_url":"https://api.github.com/users/Zaid-Ajaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zaid-Ajaj/subscriptions","organizations_url":"https://api.github.com/users/Zaid-Ajaj/orgs","repos_url":"https://api.github.com/users/Zaid-Ajaj/repos","events_url":"https://api.github.com/users/Zaid-Ajaj/events{/privacy}","received_events_url":"https://api.github.com/users/Zaid-Ajaj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-11T13:09:15Z","updated_at":"2015-10-14T18:23:54Z","closed_at":"2015-10-14T18:23:54Z","body":"Right now the expression `Infix.parse \"pi\"` returns `ParsedResult` of an identifier (i.e. `symbol \"pi\"`) .\r\nupdating the `identifier` parser solves this problem\r\n\r\n    let identifier : Expression parser =\r\n        let isIdentifierFirstChar c = isLetter c\r\n        let isIdentifierChar c = isLetter c || isDigit c\r\n        many1Satisfy2L isIdentifierFirstChar isIdentifierChar \"identifier\" .>> ws\r\n        |>> function // differentating between constants and identifiers\r\n            | \"pi\"  -> Expression.Constant Pi\r\n            | \"e\" -> Expression.Constant E\r\n            | \"oo\" | \"inf\" -> Expression.Constant PositiveInfinity // 'oo' from sympy\r\n            | \"j\" -> Expression.Constant I\r\n            | id -> Expression.Symbol id\r\nnow it works:\r\n\r\n    Infix.parse \"pi\" \r\n    // val it : ParseResult = ParsedExpression π\r\n"}}