Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > TinyBrain | #1008925 - ctxParseProperties

JavaX fragment (include)

// returns: (properties, first line not parsed)
static Pair<SS, Int> ctxParseProperties(L<S> lines, int lineIndex) {
  SS properties = litorderedmap();
  int i;
  for (i = lineIndex; i < l(lines); i++) {
    L<S> tok2 = javaTok(lines.get(i));
    if (l(tok2) == 1) continue;
    if (eqGet(tok2, 1, "[") && eqGet(tok2, 5, "]")
      && eqGet(tok2, 7, "="))
      properties.put(tok2.get(3), unquoteCtx(trim(join(subList(tok2, 9)))));
    else break;
  }
  ret pair(properties, i);
}

Author comment

Began life as a copy of #1008881

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008925
Snippet name: ctxParseProperties
Eternal ID of this version: #1008925/4
Text MD5: 72de7173b8d67b633c71ab8c1eb57bb6
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-18 20:11:20
Source code size: 494 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 25 / 43
Version history: 3 change(s)
Referenced in: [show]