~marten-de-vries/robomind-parser/github-master

« back to all changes in this revision

Viewing changes to robomind.pegjs

  • Committer: Marten de Vries
  • Date: 2015-04-25 17:32:24 UTC
  • Revision ID: git-v1:b529aab3650f15821e910ff3f160261dfdd0b073
Bug fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    }
26
26
  }
27
27
 
28
 
  function callExpression(name, args, nativeName) {
 
28
  function callExpression(name, args) {
29
29
    return {
30
30
      type: 'CallExpression',
31
31
      name: name,
32
 
      nativeName: stdlib[name] || nativeName || null,
 
32
      nativeName: stdlib[name.toLowerCase()] || null,
33
33
      arguments: args || [],
34
34
      line: line(),
35
35
      column: column()
39
39
  function fakeCall(name) {
40
40
    return {
41
41
      type: 'CallStatement',
42
 
      expr: callExpression(name, null, name)
 
42
      expr: callExpression(name, null)
43
43
    };
44
44
  }
45
45
 
69
69
// concepts borrowed from https://golang.org/ref/spec and
70
70
// https://github.com/pegjs/pegjs/blob/master/examples/javascript.pegjs
71
71
 
72
 
ID = first:Letter others:(Letter / UnicodeDigit)* {
 
72
ID = first:UnicodeLetter others:(UnicodeLetter / "_" / UnicodeDigit)* {
73
73
  return first + others.join("");
74
74
};
75
75
 
76
 
Letter = UnicodeLetter / '_'
77
 
 
78
76
UnicodeLetter
79
77
  = Lu
80
78
  / Ll