Giter Club home page Giter Club logo

icalparser's People

Contributors

bkiers avatar mcdee avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bttiato

icalparser's Issues

Does this library grammar handle content line folding properly?

Hello, I'm looking to create an ical parser for nodejs using the grammar that is provided. Reading the spec, it is under the impression that a line should be folded every so many (75) octets; a folded line is one where there is a CLRF followed by a space. Does this grammar properly account for that?

Handling Escaped Characters

More of a question that an issue, probably.

iCalendar has a number of characters which it escapes in text strings, for example the comma is escaped as , and the semicolon is escaped as ;

Should I expect the lexer to recognise these escaped sequence and unescape them, or is this something that I would need to do myself in the parser?

Handling Missing Double Quotes in Grammar Rule

I'm encountering a problem with the grammar rule for parsing the SENT-BY parameter in compliance with RFC5545 section 3.8.4.1 last example. The rule is defined as follows:

sentbyparam
   : k_sent_by ASSIGN DQUOTE cal_address DQUOTE
   ;

The issue arises when double quotes are missing from the SENT-BY parameter in an input, as shown in the last example from the section 3.8.4.1 of the RFC:

ATTENDEE;SENT-BY=mailto:[email protected];CN=John Smith:
 mailto:[email protected]

The example does not include double quotes around the email address, leading my parser to incorrectly identify SENT-BY=mailto:[email protected] as other_param. While the RFC specifies that double quotes should be present, the given example lacks them (which I believe is a mistake?).

Changing the rule to this makes it work properly:

k_sent_by ASSIGN DQUOTE? cal_address DQUOTE?

it solves the parsing issue, but it does not adhere to the RFC's requirement for double quotes.

Below is the full rule for context:

// 3.8.4.1 - Attendee
attendee
  : k_attendee attparam* COL cal_address CRLF
  ;

attparam
  : SCOL cutypeparam
  | SCOL memberparam
  | SCOL roleparam
  | SCOL partstatparam
  | SCOL rsvpparam
  | SCOL deltoparam
  | SCOL delfromparam
  | SCOL sentbyparam
  | SCOL cnparam
  | SCOL dirparam
  | SCOL languageparam
  | SCOL other_param
  ;

So my question is how can I possibly throw an error if the double quotes are missing after a SENT-BY is matched? This is a possible issue for other params as well

Two Distinct Values Assigned to Same Parameter

When parsing the RRULE recurrence there is a part in the grammar that says:

recur_rule_part
: k_freq ASSIGN freq
| k_until ASSIGN enddate
| k_count ASSIGN digits
| k_interval ASSIGN digits
| k_bysecond ASSIGN byseclist
| k_byminute ASSIGN byminlist
| k_byhour ASSIGN byhrlist
| k_byday ASSIGN bywdaylist
| k_bymonthday ASSIGN bymodaylist
| k_byyearday ASSIGN byyrdaylist
| k_byweekno ASSIGN bywknolist
| k_bymonth ASSIGN bymolist
| k_bysetpos ASSIGN bysplist
| k_wkst ASSIGN weekday
;

however in here both 'count' and 'interval' are assigned to 'digits'. It is possible to have both 'count' and 'interval' in the same rule, in which case we lose information.

Handling of Escaped Characters Split Over Multiple Lines

It appears that there is a problem when the escape character is the last character in a line of a multi-line string. For example:

LOCATION:Sabai Thai, 165-169 Princes House, Princes Place, North Street
, Brighton. BN1 1EA

In this situation the parser generates an error:

[java] line 1524:74 extraneous input '' expecting {LINE_FOLD, WSP, ESCAPED_CHAR, CRLF, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', '<', '=', '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', NON_US_ASCII}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.